微机原理及接口技?习题答案) - 百度文库 ر

ķ ѧϰָ

5. гִк AX=? ݶ: TABLE DW 100,200,300,400 ENTRY DW 3 DSʼ MOV BX,OFFSET TABLE MOV SI,ENTRY MOV AX,[BX+SI] ִк AX=2C00

6. ALе8λʽУALԭΪD7D6D0AL=D0D1D7

ο

MOV CX, 8

L: SHL AL, 1 RCR BL, 1 LOOP L MOV AL, BL

7.ʼַƫΪ2000Hڴ浥Ԫ100ASCIIַָЩַżУλ(bit7)ʹÿַС1ĸΪż˳ַΪ100HĶ˿ڡ

MOV SI, 2000H MOV CX, 100 MOV DX, 100H NEXT2: MOV AL, [SI] ;ȡַַAL AND AL, 0FFH ;ı־λ JPE NEXT1 ;1ĸΪż,bit7 OR AL, 80H ;1ĸΪ,bit7Ϊ1 NEXT1: OUT DX, AL INC SI LOOP NEXT2 MOV AH, 4CH INT 21H

8. SS=1000HSP=2000HAX=1234HBX=5678HFR=2115˵ִָ PUSH AX PUSH BX PUSHF POP CX POP DX

word

.

֮SP=? SS=? CX=? DX=? ͼָջиԪݡ

: SS=1000H

SP=1FFEH CX=2115H DX=5678H ջиԪʾ:

ַ RAM 11FFAH 2115 11FFCH 5678 11FFEH 1234 12000H

4

ϰ˼

1.±ڴд洢ʾͼ D1 DB A,123,09H, 45 D2 DW A,CD,23H, 4567H D3 DD 1234H, 23456789H

2.ӳֱ¹ܣ

1ݸIJֵжϸòż 2Ѹֵĸߡλ

3.Ӧĺ¹ܣ 1ѸIJʾ

2ĺͣʮʽʾ

.

ķ ѧϰָ

5 Գ

ϰ˼

1. ݶֽ͵ԪNUMBERFLAGжNUMBERXYĴСϵ(XYFLAG1NUMBER

.486 Data segment NUMBER db ? FLAG db ? Data ends Code segment

Assume cs: Code, ds: Data Beg: mov ax,data Mov ds,ax

mov al, X Mov bl, Y Cmp NUMBER, X Jnc P1

Mov FLAG, 0FFH Jmp exit

P1: cmp NUMBER, Y Ja P2

Mov FLAG, 00H Jmp exit

P2: mov FLAG, 01H Exit: mov ah, 4ch Int 21h Code ends End Beg

2. 123100ѺͱSUMԪС .486

DATA SEGMENT USE16

TT DB 1 SUM DW ? DATA ENDS

CODE SEGMENT USE16

word

.

ASSUME CS:CODE,DS:DATA BEG: MOV AX , DATA MOV DS, AX MOV CX, 100 MOV AX, 0 START: ADD AX, TT INC TT

LOOP START MOV SUM, AX MOV AH, 4CH MOV 21H

CODE ENDS

END BEG

3. һNݣð򷨽 .486

Data segment

Buf db abcd18437hj Lens equ $-buf Count db lens Flag db ? Data ends Code segment

Assume cs: code, ds: data Beg: mov ax, data Mov ds, ax Again: dec count Jz done Mov flag, 0 Mov cx, count

Mov si, offset buf Last: mov al, [si] Mov ah, [si+1] Cmp ah, al Jnc next

Mov [si], ah Mv [si+1], al Mov flag, 1 Next: inc si

.