?? 522.asm
字號:
;522.asm
;*****************************************************************************
datasg segment
buffer label byte
max db 81
act db ?
char db 81 dup(?)
;
letter db 'letter:',?,?,13,10,'$'
digit db 'digit:',?,?,13,10,'$'
other db 'other:',?,?,13,10,'$'
datasg ends
;****************************************************************************
codesg segment
;----------------------------------------------------------------------------
main proc far
assume cs:codesg,ds:datasg
start:
push ds
sub ax,ax
push ax
mov ax,datasg
mov ds,ax
lea dx,buffer
mov ah,0ah
int 21h
mov cl,act
mov si,00h
mov bh,00h
mov bl,00h
mov dl,00h
again: cmp cl,0
jz next
mov al,char[si]
cmp al,7ah
jg othe
cmp al,60h
jg lette
cmp al,5ah
jg othe
cmp al,40h
jg lette
cmp al,39h
jg othe
cmp al,2fh
jg digi
othe: mov al,1
add al,dl
daa
mov dl,al
jmp short repeat
lette: mov al,1
add al,bh
daa
mov bh,al
jmp short repeat
digi: mov al,1
add al,bl
daa
mov bl,al
repeat:inc si
dec cl
jmp short again
next: mov cl,4
mov al,bh
and al,0fh
add al,30h
mov letter+8,al
mov al,bh
rol al,cl
and al,0fh
add al,30h
mov letter+7,al
mov al,bl
and al,0fh
add al,30h
mov digit+7,al
mov al,bl
rol al,cl
and al,0fh
add al,30h
mov digit+6,al
mov al,dl
and al,0fh
add al,30h
mov other+7,al
mov al,dl
rol al,cl
and al,0fh
add al,30h
mov other+6,al
;
mov dl,0dh
mov ah,02h
int 21h
mov dl,0ah
mov ah,02h
int 21h
lea dx,letter
mov ah,09h
int 21h
lea dx,digit
mov ah,09h
int 21h
lea dx,other
mov ah,09h
int 21h
ret
main endp
;----------------------------------------------------------------------------
codesg ends
;***************************************************************************
end start
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -