注册 登录
编程论坛 汇编论坛

我的程序有点错误请看看!

sjyf 发布于 2005-10-26 20:59, 705 次点击

;input a capital letter change it opposite one data segment mess db ' please input: ''$' data ends ;----------------------------- code segment assume cs:code,ds:data ;---------------------- start: push cs sub ax, ax push ax

;--------------------------- mov ax, data mov ds, ax ;--------------------------- again: lea dx, mess ;ouput message mov ah, 09 int 21h mov ah, 01 ;input int 21h cmp al, 30h ;if input 0 exit je exit cmp al, 61h ;judge the letter jb next ;the input is't a capital sub al, 20h next: mov dl, al mov ah, 2 int 21h jmp again ;move in circles

exit: ret

code ends end start

2 回复
#2
sjyf2005-10-26 21:03
代码能运行无误,但是有一点不符合我的最初的意识: 如果输入0,退出,但是不退出,还有 :在输出  ' please input: '时输入的不是 please input : 而是 please input: ' 把分号去掉编译时出现警告!
希望高手解答一下!
#3
sjyf2005-10-27 14:05

;input a capital letter change it opposite one data segment mess db ' please input: ','$' data ends ;----------------------------- code segment assume cs:code,ds:data ;---------------------- start: push cs sub ax, ax push ax

;--------------------------- mov ax, data mov ds, ax ;--------------------------- again: lea dx, mess ;ouput message mov ah, 09 int 21h mov ah, 01 ;input int 21h cmp al, 30h ;if input 0 exit je exit cmp al, 61h ;judge the letter jb next ;the input is't a capital sub al, 20h next: mov dl, al mov ah, 2 int 21h jmp again ;move in circles

exit: ret

code ends end start 经过修改已经可以了!

1