《考研资料》作业8答案.doc
作业81 设DS=2000H,BX=1256H,SI=528FH,位移量TABLE=20A1H,232F7H=3280H,264E5H=2450H,执行下列指令:(1) JMB BX; IP=?1256H(2) JMP TABLEBX; IP=?3280H(3) JMP B XSI;IP=?2450H2 设IP=3D8FH,CS=4050H,SP=0F17CH,当执行CALL 2000:009AH后,试指出CS,IP,SP,SP,SP+1,SP+2,SP+3的内容。IP-009AH,CS=2000H,SP=0F178H,SP=94H,SP+1=3DH,SP+2=50H,SP+3=40H3 设X,Y变量中均为16位操作数,先判断X是否大于50,如大于则转移到N_HIGH,否则做X-Y。相减 后如溢出则转移到OVERFLOW去执行,否则个求(X-Y)的绝对值,并把结果存入RESULT中。 MOV AX,XCMP AX,50JG N_HIGHSUB AX,YJO OVERFLOWJNS NEXTNEG AXNEXT: MOV RESULT,AXHLTN_HIGH: . .OVERFLOW: .(4) 设某数据采集系统连续采集到3个数(16位符号数),存放在NUM1,NUM2,NUM3中,试找出这3个数中的中间值(即中值滤波),并存入NUM中。MOV AX,NUM1CMP AX,NUM2JL A_LESS_THEN_BCMP AX,NUM3JG A_GREATER_THEN_CMIDDLE_A: MOV NUM,AXJMP EXITA_GREATER_THEN_C: MOV AX,NUM2CMP AX,NUM3JL MIDDLE_CMIDDLE_B: MOV NUM,AXJMP EXITMIDDLE_C: MOV AX,NUM3MOV NUM,AXJMP EXITA_LESS_THEN_B: CMP AX,NUM3JGE MIDDLE_AMOV AX,NUM2CMP AX,NUM3JGE MIDDLE_CJMP MIDDLE_BEXIT: HLT