实验1
https://blog.csdn.net/xyisv/article/details/78647405
代码如下:
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
实验结果截图
实验2
https://blog.csdn.net/xyisv/article/details/78647400
我这里假设x为5 y为-3 z为2 那么(x+y)*z的结果为4,运行结果如下图所示
参考程序:
data segmentx db 5
y db -3
z db 2
w db ?
data ends;
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov dx,0
mov al,x
adc al,y
mov bl,z
imul bl
lea bx,w
mov [bx],ax
add al,30h
mov dl,al
mov ah,02h
int 21h
mov ah,4ch
int 21h
code ends
end start