第1个回答 2016-12-19
code segment
assume cs:code
org 100h
start:jmp begin
msg db 13,10,13,10,'PLEASE INPUT:$'
char1 db ?
m dw 0
big db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
bign equ $-big
loww db 'abcdefghijklmnopqrstuvwxyz'
lown equ $-loww
dig db '0123456789'
dign equ $-dig
begin:push cs
pop ds
push cs
pop es
@0:
mov word ptr m,0
lea dx,msg
mov ah,9
int 21h
mov ah,1
int 21h
mov char1, al
cmp al,13
je @exit
mov cx,bign
mov al,char1
cld
lea di,big
repne scasb
cmp cx,0
je @1
mov ah,2
mov dl,'U'
int 21h
inc word ptr m
@1:
mov cx,lown
mov al,char1
cld
lea di,loww
repne scasb
cmp cx,0
je @2
mov ah,2
mov dl,'L'
int 21h
inc word ptr m
@2:
mov cx,dign
mov al,char1
cld
lea di,dig
repne scasb
cmp cx,0
je @3
mov ah,2
mov dl,'N'
int 21h
inc word ptr m
@3:
cmp word ptr m,0
jne @0
mov dl,'*'
mov ah,2
int 21h
jmp @0
@exit:
mov ah,4ch
int 21h
code ends
end start本回答被网友采纳
第2个回答 2017-11-06
data segment
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
k:mov ah,1
int 21h
mov bl,al
mov dl,0ah
mov ah,2
int 21h
mov dl,0dh
mov ah,2
int 21h
cmp bl,'0'
jl shuchu*
jnl a
a:cmp bl,'9'
jng b
jg c
shuchu*:mov dl,'*'
mov ah,2
int 21h
jmp k
b:mov dl,'N'
mov ah,2
int 21h
jmp k
c:cmp bl,'A'
jl shuchu*
jnl d
d:cmp bl,'Z'
jng e
jg f
f:cmp bl,'a'
jl shuchu*
jnl g
g:cmp bl,'z'
jng h
jg shuchu*
h:mov dl,'L'
mov ah,2
int 21h
jmp k
e:mov dl, 'U'
mov ah,2
int 21h
jmp k
code ends
end start