简体   繁体   English

8086汇编语言关于登录注册账号

[英]8086 assembly language about log in and sign up account

For the login part is good, everything works well on that part.对于登录部分很好,那部分一切正常。 But for registering a new account part, it keeps showing the invalid message although I full all the requirements which are username cant be repeated and the length of username should be more than 5 letters.但是对于注册新帐户部分,尽管我满足了用户名不能重复和用户名长度应超过5个字母的所有要求,但它一直显示无效消息。

Here is my code这是我的代码

Here is the problem that I facing now:这是我现在面临的问题:
这是我现在面临的问题

Although it's a bit long, I hope u guys can take time for looking at it.虽然有点长,希望大家抽空看看。 This is my assignment.这是我的任务。

An unfortunate fall-through problem一个不幸的失败问题

 call isValidUserName cmp aX, 1 JNE oor4 mov si, offset regUser call checkLength cmp cx, 5 JBE oor5 <=== All is well: Need to jump to `askPsw` here oor4: jmp invalidacc oor5: jmp invalidUserLength askPsw:

The code is missing a crucial jmp .该代码缺少一个关键的jmp For now the code falls through in oor4 eventhough the new username is long enough.目前代码在oor4中失效,尽管新用户名足够长。

Next code solves the problem and avoids adding yet another jump to the program (mainly by inverting the condition):接下来的代码解决了这个问题并避免向程序添加另一个跳转(主要是通过反转条件):

    call isValidUserName     ; -> AX=[0=NOK, 1=OK]
    cmp  ax, 1
    JNE  oor4
    mov  si, offset regUser
    call checkLength         ; -> CX
    cmp  cx, 5
    JA   askPsw
  oor5:
    jmp  invalidUserLength
  oor4:
    jmp  invalidacc
     
askPsw:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM