开发者

Compare bits in assembly

开发者 https://www.devze.com 2023-03-01 14:06 出处:网络
How can I compare two bits if they are equal or not in 8051? I need to jump if two bits are equal. I have a value in a register and I am searching if this value is equal another constant value. Exampl

How can I compare two bits if they are equal or not in 8051? I need to jump if two bits are equal. I have a value in a register and I am searching if this value is equal another constant value. Example: I have "EDh开发者_运维百科" value and I have another value in R0 register.


To compare a register and an immediate (a constant), and then conditionally jump, you can use the CJNE instruction.


It's been a long time since I worked with the 8051. But I seem to remember that the CJNE instruction was quite useful.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号