首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >程序集登录程序总是返回错误的密码。

问程序集登录程序总是返回错误的密码。
EN

Stack Overflow用户
提问于 2013-10-28 12:00:47
回答 1查看 1.1K关注 0票数 0

我正在编写一个汇编程序,它将接受用户输入并对变量进行检查,但出于某种原因,这段代码总是会说密码输入错误。请注意,我没有包括一些调用的代码,但我确信它们确实有效,因为我在许多其他示例中都很好地使用了它们。基本上,我需要知道为什么这拒绝识别我的输入和字符串匹配。任何帮助都是非常感谢的。

代码语言:javascript
复制
start:
mov ax, login_input
mov bx, login_message
call os_input_dialog     ;opens a dialog box that shows the string login_message,
                                  ;then it takes user input andd stores it in ax

mov si, login_input      
mov di, password
cmp si, di                    ;compares input against the password
je app_selector            ;if equal, jump to the next part of code

jmp start                     ;otherwise try again


login_input               times 12 db 0
login_message            db 'Password: '
password                    db 'root'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-28 12:12:36

甚至不是比较字符串,而是比较字符串的基址,它们永远都不相等。您需要比较每个字符串的每个元素,以了解它们是否相等。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19634264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档