标题:我的程序有点错误请看看!
只看楼主
sjyf
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2005-10-18
 问题点数:0 回复次数:2 
我的程序有点错误请看看!

;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

搜索更多相关主题的帖子: change 
2005-10-26 20:59
sjyf
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2005-10-18
得分:0 
代码能运行无误,但是有一点不符合我的最初的意识: 如果输入0,退出,但是不退出,还有 :在输出  ' please input: '时输入的不是 please input : 而是 please input: ' 把分号去掉编译时出现警告!
希望高手解答一下!
2005-10-26 21:03
sjyf
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2005-10-18
得分:0 

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

2005-10-27 14:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-31521-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013349 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved