8051 jbc instruction help

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?

Reply to
PagCal
Loading thread data ...

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

Reply to
Meindert Sprang

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.