汇编程序(很急)

来源:百度知道 编辑:UC知道 时间:2024/06/06 10:04:57
各位电脑高手帮帮忙!
分支程序设计:要求从键盘接受一个字符,并判断是否是“0~9”数字键,如果是则提示:it is a number!,如果不是则提示:it is not a number!
循环程序设计:写一个把字符串中的所有大写字母改为小写的程序假设字符串以‘0’结尾。

今天刚考完汇编,看了那些垃圾试题很郁闷。给你写下吧。
data segment
input db 'please input ont char:$'
output1 db 'it is a number$'
output2 db 'it is not a number$'
change db 0ah,0dh,'$'
data ends
code segment
main proc far
assume cs:code ,ds:data
start:
mov ax, data
mov ds,ax
mov ah,09
mov dx,offset input
int 21h
mov ah,01h
int 21h
push ax
mov ah,09h
mov dx,offset change
int 21h
pop ax
mov ah,09h
cmp al,'0'
jb nott
cmp al,'9'
ja nott
mov dx,offset output1
int 21h
jmp exit
nott:
mov dx,offset output2
int 21h
exit:
mov ah,4ch
int 21h
main endp
code ends
end start
输入一个字符判断是不是数字。09.06.22

data segment
string db 'abBADFGF0'
data ends
code segment
main proc far
assume cs:code ,ds:data
start:
mov ax,data
mov ds,ax