【问题标题】:MSP430 JC, JNC , JEQ and JNZMSP430 JC、JNC、JEQ 和 JNZ
【发布时间】:2014-10-15 15:45:20
【问题描述】:

我在查看 MSP430 的指令集时偶然发现了一些我不太理解的东西。我似乎无法区分JCJNZJNCJEQ 之间的区别。我了解JEQJNZ的功能,但我对JCJNC的用法有点模糊。

我知道JCJNC 使用进位标志的事实,但我不确定它的使用方式以及它们与JNZJEQ 有何不同。

【问题讨论】:

    标签: assembly msp430 instruction-set


    【解决方案1】:
    JC = Jump if carry set (C=1)
    JNC = Jump if carry is not set (C=0)
    JZ = Jump if zero-flag is set
    JNZ = Jump if zero-flag is not set
    
    JEQ = Jump if equal => another 'name' for JZ
    (There are many instruction aliases').
    

    当您添加两个设置了最高位的数字时,您最终会得到比原始数字长一位的结果。这个新的比特“去”携带。它也用作减法中的借用标志。比较与减法相同,只是不存储结果值。

    这就是 SBC 对标志所做的:

    Status Bits N: Set if result is negative, reset if positive
    Z: Set if result is zero, reset otherwise
    C: Set if there is a carry from the MSB of the result, reset otherwise.
    Set to 1 if no borrow, reset if borrow.
    V: Set if an arithmetic overflow occurs, reset otherwise.
    

    【讨论】:

      猜你喜欢
      • 2017-03-12
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      • 2013-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多