学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

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

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

;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

TOP

代码能运行无误,但是有一点不符合我的最初的意识: 如果输入0,退出,但是不退出,还有 :在输出  ' please input: '时输入的不是 please input : 而是 please input: ' 把分号去掉编译时出现警告!
希望高手解答一下!

TOP

;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 经过修改已经可以了!

TOP

发新话题