钱晓捷第五版习题4 题4.8 bufx bufy bufz 为三个有符号十六进制数编写一个比较相等关系的程序如果这三个数都不相等则显示0,其中两个相等显示1 ,三个都相等则显示2
data segment
bufX db 1h
bufY db 0h
bufZ db 1h
sum dd ?
data ends
code segment
assume cs:code,ds:data
start:
mov dl,0h;统计相等个数
mov ax,data
mov ds,ax
mov al,bufX
mov bl,bufY
mov cl,bufZ
one : cmp al,bl
je two
jmp three
two : inc dl
cmp al,cl
je last
three: cmp al,cl
je last
cmp bl,cl
je last
last: inc dl
add dl,30h
mov ah,02h
int 21h
code ends
end start