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