【实验内容】
用16位指令编写完整程序,实现下列数据定义语句和相关指令,在debug下查看内存数据的定义情况,单步跟踪查看各寄存器的值。
题目:
ORG 0
ARRAY LABEL BYTE
DA1 DW 2,9,14,3,315H,-6
DA2 DB 7,‘ABCDEDFG’
LEN = $-DA2
ORG 100H
DA3 DW DA4
DA4 DB 4 DUP(2 DUP(1,2,3),4)
…………
MOV AL,ARRAY+2 (AL)=( )H
ADD AL,DA2+1 (AL)=( )H
MOV AX,DA2-DA1 (AX)=( )H
MOV BL,LEN (BL)=( )H
MOV AX, DA3 (AX)=( )H
MOV BX, TYPE DA4 (BX)=( )H
MOV BX, OFFSET DA4 (BX)=( )H
MOV CX, SIZE DA4 (CX)=( )H
MOV DX, LENGTH DA4 (DX)=( )H
MOV BX, WORD PTR DA4 (BX)=( )H
MOV BL, LEN AND 0FH (BL)=( )H
MOV BL, LEN GT 5 (BL)=( )H
MOV AX, LEN MOD 5 (AX)=( )H
填后的答案:
MOV AL,ARRAY+2 (AL)=( 09 )H
ADD AL,DA2+1 (AL)=( 41 )H
MOV AX,DA2-DA1 (AX)=( 000c )H
MOV BL,LEN (BL)=( 09 )H
MOV AX, DA3 (AX)=( 0102 )H
MOV BX, TYPE DA4 (BX)=( 0001 )H
MOV BX, OFFSET DA4 (BX)=( 0102 )H
MOV CX, SIZE DA4 (CX)=( 0004 )H
MOV DX, LENGTH DA4 (DX)=( 0004 )H
MOV BX, WORD PTR DA4 (BX)=( 0201 )H
MOV BL, LEN AND 0FH (BL)=( 09 )H
MOV BL, LEN GT 5 (BL)=( ff )H
MOV AX, LEN MOD 5 (AX)=( 0004 )H
具体代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
DATA SEGMENT ORG 0 ARRAY LABEL BYTE DA1 DW 2,9,14,3,315H,-6 DA2 DB 7,'ABCDEDFG' LEN = $-DA2 ORG 100H DA3 DW DA4 DA4 DB 4 DUP(2 DUP(1,2,3),4);1 2 3 1 2 3 4 *4times DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DX,AX MOV AL,ARRAY+2;MOV AL,[0002] ADD AL,DA2+1;MOV AL,[000D] MOV AX,DA2-DA1;MOV AX,000C;DA1的长度 MOV BL,LEN;MOV BL,09;DA2的长度 MOV AX,DA3;MOV AX,[0100] MOV BX,TYPE DA4;MOV BX,0001 MOV BX,OFFSET DA4;MOV BX,0102 MOV CX,SIZE DA4;MOV CX,0004 MOV DX,LENGTH DA4;MOV DX,0004 MOV BX,WORD PTR DA4;MOV BX,[0102] MOV BL,LEN AND 0FH;MOV BL,09 MOV BL,LEN GT 5;MOV BL,FF MOV AX,LEN MOD 5;MOV AX,0004 MOV AH,4CH INT 21H CODE ENDS END START |
最后一步内存情况: