8051 jbc instruction help
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
8051 jbc instruction help

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
PagCal
Guest





Posted: Wed Dec 14, 2005 4:19 pm    Post subject: 8051 jbc instruction help Reply with quote

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?
Back to top
Meindert Sprang
Guest





Posted: Wed Dec 14, 2005 4:47 pm    Post subject: Re: 8051 jbc instruction help Reply with quote

"PagCal" <pagcal@runbox.com> wrote in message
news:glSnf.77$Vr.73@fe06.lga...
Quote:

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
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB