1、微机 作业答案CH1P192. 运算器、控制器、存储器、输入设备、输出设备4.(1) 29.6875 D (2) 10010011B,93H(3) 940D (4) 01100000B or 96D(5) FFH, -5BH (6) -0EH, -72H, -71H, 8EH(7) (a) 45H or 69D ,no overflow (b) -6EH or -110D ,no overflow (c) -46H or -70D , no overflow(d) -76H , overflow;补充作业1.已知数据段12345H单元内容55H,X单元内容为66H,连续执行下列指令后,AL=?
2、,X单元内容=? MOV AX,1000H MOV DS,AX MOV BX,2345H MOV AL,BX MOV SI,X单元偏移地址 MOV SI,BL2. 已知DS=3000H,ES=4000H,BX=1000H, 内存单元地址 内容 31000H 34H 31001H 12H 41000H 78H 41001H 56H 请问执行 1. MOV AX,BX; AX=? 2.MOV AX,ES:BX; AX=? 3. MOV AH,ES:BX;AH=?3. 一个有16个字的数据区,它的起始地址为70A0H:DDF6H,请写出这个数据区首末字单元的物理地址。4. BUF DB THE QU
3、ICK BROWN FOX LL EQU $-BUF S1 DB HELLO LLL EQU $-S1 LLLL EQU $-BUF 请分别写出 LL=?, LLL=?,LLLL=? (1) AL=55H, X= 45H (2) AX = 1234H , AX = 5678H , AH = 78H(3) START ADDRESS: 70A0:DDF6 - START HARDWARE ADDRESS: 7E7F6H END HARDWARE ADDRESS: 7E814H(4) 19,5,24CH31 写出下列用逻辑地址表示的存储单元的物理地址。(1)1234H:5678H (179B8H)
4、 2列表写出下列指令中目标操作数、源操作数的寻址方式,如果有非法的内存操作数请改正,并写出CPU所寻址的逻辑段。(1)MOV BX, 50 寄存器寻址,立即寻址, (2)CMP BX, 100 间接寻址,立即寻址,CMP WORD PTR BX, 100CMP BYTE PTR BX, 100; 数据段(3)ADD SI, 1000 间接寻址,立即寻址, ADD WORD PTR SI, 1000,数据段(4)MOV BP, SP 寄存器寻址,寄存器寻址,(5)MOV BX, BP + 4 寄存器寻址,基址寻址,堆栈段(6)MOV AX, BX + DI + 5 寄存器寻址,基址加变址寻址,数
5、据段3以216为模,将C678H分别和下列各数相加,列表写出十六进制和数,以及A、C、O、P、S、Z 六种状态标志的值。(1)CF23H (959BH,0,1,0,0,1,0)P130-1315(1)-.486DATA SEGMENT USE16 FIRST DB 12H,34H SECOND DB 56H,78HDATA ENDSCODE SEGMENT USE16 ASSUME CS:CODE,DS:DATA BEG:MOV AX,DATA MOV DS,AX MOV AL,FIRST XCHG SECOND,AL MOV FIRST,AL MOV AL,FIRST+1 XCHG SECO
6、ND+1,AL MOV FIRST+1,AL MOV AH,4CH INT 21HCODE ENDS END BEG 5 (2)-.486DATA SEGMENT USE16 FIRST DB 12H,34H SECOND DB 56H,78HDATA ENDS; Not define the stack segment,use default stack instead.CODE SEGMENT USE16 ASSUME CS:CODE,DS:DATA BEG:MOV AX,DATA MOV DS,AX PUSH WORD PTR FIRST PUSH WORD PTR SECOND POP
7、 WORD PTR FIRST POP WORD PTR SECOND MOV AH,4CH INT 21HCODE ENDS END BEG 6.-TABLE DW 158,258,358,458 contents in the memory as:9EH,00H,02H,01H,66H,01H,CAH,01H The number in the AX register is 6601H (26113D)7.-1193182 - 1234DE H. MOV EAX, 1193182 MOV EDX, 0 MOV ECX, 433 DIV ECX MOV XX, AX 8-.486CODE S
8、EGMENT USE16 ASSUEM CS:CODE BEG:SAL AL,4 SAL AX,4 MOV AH,4CH INT 21HCODE ENDS END BEG 9.- .486CODE SEGMENT USE16 ASSUME CS:CODE BEG: MOV CX,8 MOV AL,3 ; supposed that the number in AL register is 03H CIR: SHR AL,1 RCL BL,1 LOOP CIR MOV AL,BL MOV AH,4CH INT 21HCODE ENDS END BEG 10(1)- .486DATA SEGMEN
9、T USE16 BUF DB 50 DUP(?) PLUS DB 50 DUP(?) MINUS DB 50 DUP(?)DATA ENDSCODE SEGMENT USE16 ASSUME CS:CODE,DS:DATA BEG: MOV AX,DATA MOV DS,AX MOV BX,OFFSET BUF MOV SI,OFFSET PLUS MOV DI,OFFSET MINUS MOV CX,50 CIR: MOV AL,BX CMP BYTE PTR BX,0 JZ NEXT JG TOPLUS MOV DI,AL INC DI JMP NEXT TOPLUS: MOV SI,AL
10、 INC SI NEXT: INC BX LOOP CIR EXIT: MOV AH,4CH INT 21HCODE ENDS END BEG 10(2)- .486DATA SEGMENT USE16 BUF DB 50 DUP(?) NOTO DB 50 DUP(?)DATA ENDSCODE SEGMENT USE16 ASSUME CS:CODE,DS:DATA BEG: MOV AX,DATA MOV DS,AX MOV BX,OFFSET BUF MOV SI,OFFSET NOTO MOV CX,50 CIR: CMP BYTE PTR BX,0 JZ NEXT MOV AL,B
11、X MOV SI,AL INC SI NEXT: INC BX LOOP CIR EXIT: MOV AH,4CH INT 21HCODE ENDS END BEG10 (3)-.486DATA SEGMENT USE16 BUF DB 50 DUP(?)DATA ENDSCODE SEGMENT USE16 ASSUME CS:CODE,DS:DATA BEG: MOV AX,DATA MOV DS,AX MOV BX,OFFSET BUF MOV CX,50 CIR: CMP BYTE PTR BX,0 JGE NEXT NEG BYTE PTR BX NEXT: INC BX LOOP
12、CIR EXIT: MOV AH,4CH INT 21HCODE ENDS END BEG 10(4)- .486DATA SEGMENT USE16 BUF DB 50 DUP(?)DATA ENDSCODE SEGMENT USE16 ASSUME CS:CODE,DS:DATA BEG: MOV AX,DATA MOV DS,AX MOV BX,OFFSET BUF BT DWORD PTR BX,31 JNC EXIT NEG DWORD PTR BX EXIT: MOV AH,4CH INT 21HCODE ENDS END BEG-CH41.486DATA SEGMENT USE16NUMBER DB ?FLAG DB -1DATA ENDSCODE SEGMENT USE16 ASSUME CS:CODE,DS:DATABEG: MOV AX,DATA MOV DS,AX CMP NUMBER,5 JNA EXIT CMP NUMBER,24 JA EXIT MOV FLAG,0EXIT: MOV AH,4CH INT 21HCODE ENDS END BEGAssignment 4# SUPPLEMENT: SS= 2250H, SP= 0136H SS= 2250H, SP= 013AH