简体   繁体   English

MSP430 JC、JNC、JEQ 和 JNZ

[英]MSP430 JC, JNC , JEQ and JNZ

I was looking through the MSP430's instruction set and stumbled upon something I can't quite understand.我在查看 MSP430 的指令集时偶然发现了一些我不太明白的东西。 I can't seem to differentiate what the difference between JC and JNZ and JNC and JEQ .我似乎无法区分JCJNZ以及JNCJEQ之间的区别。 I understand the functions of JEQ and JNZ , but I'm a Little fuzzy on the usage of JC and JNC .我了解JEQJNZ的功能,但对JCJNC的用法有点模糊。

I know for a fact JC and JNC utilize the carry flag, but I'm not sure in what way it's used and how they differ from JNZ and JEQ .我知道JCJNC使用进位标志,但我不确定它的使用方式以及它们与JNZJEQ不同之处。

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').

When you add two numbers with highest bit set, you'd end up with result with one bit longer that the original numbers.当您将两个设置了最高位的数字相加时,您最终会得到比原始数字长一位的结果。 This new bit "goes" to carry.这个新的位“去”携带。 It's also used as borrow-flag in subtractions.它也用作减法中的借用标志。 Compare is the same as subtraction except that the result value is not stored.比较与减法相同,只是不存储结果值。

That's what SBC does to the flags:这就是 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.

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

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