8051 jbc instruction help

Dec 14, 2005 1 Replies

jump if bit set and clear (jbc) has 3 bytes:



0x10 - the instruction 0xbit - the bit number 0xoff - the relative pc offset to take if bit set

the question is, which pc is the 'off' relative to?



In other words, if my program has:



pc code ------------- 5 0x10 6 bit 7 off



is the 'off' relative to pc = 7 or pc = 8 or some other pc?


Well, the datasheet says: "The range of the jump is therefore -128 to +127 Program Memory bytes relative to the first byte following the instruction." So, it is relative to pc = 8.

Meindert

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required