数据段:
DATAS SEGMENT
X DB 3
Y DB 4
RESULT DB ?
DATAS ENDS;
将X+Y的结果送入到RESULT中,然后将RESULT的值输出到控制台(格式(X+Y=RESULT):3+4=7)
注意:
程序是可以直接拷贝就能运行,尽量将输出语句仔细说明。
谢谢了!
------解决方案--------------------
datas segment
x db 3
y db 4
result db ?
datas ends
code segment
assume cs:code, ds:datas
start:
mov ax, datas
mov ds, ax
mov ah, x
mov al, y
add al, ah
mov result, al;做加法运算
mov ah, 2
mov dl, result
add dl, 30h
int 21h ;将结果打印到屏幕
mov ah, 4ch
int 21h
code ends
end start