|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Data segment
string1 db 'Input your string:$
string2 db 'Digit:$'
string3 db 'Letter:$'
string4 db 'Other:$'
Digit db 0
Letter db 0
Other db 0
data ends
prognam segment
main proc far
assume cs:prognam,ds:data
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
lea dx,string1
mov ah,9
int 21h
mov cx,80
L1:
mov ah,1
int 21h
cmp al,0dh
jz over
cmp al,30h
jb others
cmp al,39h
ja L2
jmp digits
L2:
cmp al,41h
jb others
cmp al,5ah
ja L3
jmp letters
L3:
cmp al,61h
jb others
cmp al,7ah
ja others
jmp letters
digits:
inc digit
jmp over1
others:
inc other
jmp over1
letters:
inc letter
jmp over1
over1:
loop L1
over:
call endline
lea dx,string2
mov ah,9
int 21h
sub ax,ax
mov al,digit
call display
call endline
lea dx,string3
mov ah,9
int 21h
sub ax,ax
mov al,letter
call display
call endline
lea dx,string4
mov ah,9
int 21h
sub ax,ax
mov al,other
call display
ret
main endp
endline proc near
mov ah,2
mov dl,0ah
int 21h
mov ah,2
mov dl,0dh
int 21h
ret
endline endp
display proc near
mov dl,al
add dl,30h
mov ah,2
int 21h
ret
display endp
prognam ends
end start
这是老师布置的一端代码!求大神能在每段代码前做上注释。并具体分析这段代码是做什么的,包括哪段调用哪段~
谢谢了
|
|