汇编程序从键盘输入一个字符,判断该字符是小写字母、大写字母、数字或其他字符,
2个回答
展开全部
为防抽,加一句中文:程序如下:
dseg segment
msglf db 0ah, 0dh, '$'
msgup db 'a big character.', 0ah, 0dh, '$'
msglo db 'a small character.', 0ah, 0dh, '$'
msgnum db 'a digit characgter.', 0ah, 0dh, '$'
msgot db 'other character.', 0ah, 0dh, '$'
dseg ends
cseg segment
assume ds:dseg, cs:cseg
begin:
mov ax, dseg
mov ds, ax
mov ah, 1
int 21h
mov bl, al
lea dx, msglf
mov ah, 9
int 21h
mov al, bl
cmp al, '0'
jl OtherC
cmp al, '9'
jg NotNum
lea dx, msgnum
jmp Output
NotNum:
cmp al, 'A'
jl OtherC
cmp al, 'Z'
jg NotUp
lea dx, msgup
jmp Output
NotUp:
cmp al, 'a'
jl OtherC
cmp al, 'z'
jg OtherC
lea dx, msglo
jmp Output
OtherC:
lea dx, msgot
Output:
mov ah, 9
int 21h
mov ah, 4ch
int 21h
cseg ends
end begin
dseg segment
msglf db 0ah, 0dh, '$'
msgup db 'a big character.', 0ah, 0dh, '$'
msglo db 'a small character.', 0ah, 0dh, '$'
msgnum db 'a digit characgter.', 0ah, 0dh, '$'
msgot db 'other character.', 0ah, 0dh, '$'
dseg ends
cseg segment
assume ds:dseg, cs:cseg
begin:
mov ax, dseg
mov ds, ax
mov ah, 1
int 21h
mov bl, al
lea dx, msglf
mov ah, 9
int 21h
mov al, bl
cmp al, '0'
jl OtherC
cmp al, '9'
jg NotNum
lea dx, msgnum
jmp Output
NotNum:
cmp al, 'A'
jl OtherC
cmp al, 'Z'
jg NotUp
lea dx, msgup
jmp Output
NotUp:
cmp al, 'a'
jl OtherC
cmp al, 'z'
jg OtherC
lea dx, msglo
jmp Output
OtherC:
lea dx, msgot
Output:
mov ah, 9
int 21h
mov ah, 4ch
int 21h
cseg ends
end begin
2012-11-01
展开全部
转化ASCII码
追问
谔谔 我要的是程序
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询