看雪上一个程序的小问题不懂~
最后输出为什么DL还要+48呢?~assume CS:code,DS:data
data segment
line db '23456@#%SDFghj','$'
da1 db 0
da2 db 0
da3 db 0
res1 db 0ah,0dh,'letter:','$'
res2 db 0ah,0dh,'number:','$'
res3 db 0ah,0dh,'others:','$'
data ends
code segment
start:
mov AX,data
mov DS,AX
lea BX,line
mov CX,000eh
s:
mov DL,[BX]
cmp DL,30h
js s0
cmp DL,39h
jns c1
s1:
mov DH,da1
inc DH
mov da1,DH
jmp theends
c1:
cmp DL,41h
js s0
c2:
cmp DL,5ah
jns c3
s2:
mov DH,da2
inc DH
mov da2,DH
jmp theends
c3:
cmp DL,61h
js s0
cmp DL,7ah
js s2
jz s2
s0:
mov DH,da3
inc DH
mov da3,DH
jmp theends
theends:
inc BX
loop s
lea DX,line
mov Ah,09
int 21h
lea DX,res1
mov Ah,09
int 21h
mov DL,DS:[da1]
add DL,48
mov Ah,02
int 21h
lea DX,res2
mov Ah,09
int 21h
mov DL,DS:[da2]
add DL,48
mov Ah,02
int 21h
lea DX,res3
mov Ah,09
int 21h
mov DL,DS:[da3]
add DL,48
mov Ah,02
int 21h
mov AX,4c00h
int 21h
code ends
end start