EmbDev.net

Forum: µC & Digital Electronics help about opcode


von sa (Guest)


Rate this post
useful
not useful
hello
i have an opcode of BNE and i want to know which address it jmb
the opcode is 1AFFFFF9 if there is who know how can i understand which 
address go this brunch

: Moved by Admin
von Andreas S. (andreas) (Admin)


Rate this post
useful
not useful
How about telling us which processor you are talking about? Also you 
could most likely find a description of the opcodes of your processor on 
the vendor website.

von sa (Guest)


Rate this post
useful
not useful
thank you andreas for your reply
the processor is DSP TMX320AV7111GFN i think it contain arm7,isn't it?
and i want to ask you is all the arm processor has his description of 
the opcodes??

von sa (Guest)


Rate this post
useful
not useful
the processor is ARM7TDMI

von Peter D. (pdiener)


Rate this post
useful
not useful
http://www.ece.wisc.edu/~morrow/ECE353/arm7tdmi_instruction_set_reference.pdf

1AFFFFF9 means

1 = Condition: not equal
A = Branch (Link = 0)
FFFFF9 = offset

Branch if not equal
  PC := PC + (offset << 2);

This branch can initiate a jump in negative direction to an address that 
is 7 instructions or 28 bytes ahead.

von SA (Guest)


Rate this post
useful
not useful
thank you very much Peter
Can you give me an example to Understand more ,please

von SA (Guest)


Rate this post
useful
not useful
what does you mean about negative direction

von Peter D. (pdiener)


Rate this post
useful
not useful
The offset is given in two's complement to encode positive and negative 
numbers
http://en.wikipedia.org/wiki/Two%27s_complement

This is because it is a relative jump that can jump forward and 
backwards. So the offset is the number of instructions to jump (from the 
current position of the program counter), which can be positive to jump 
in forward direction or negative to jump in reverse direction.

An offset of FFFFF9 (which is -7 in two's complement) means, that a jump 
from the current position to a position that is 7 instructions earlier 
is performed.

von SA (Guest)


Rate this post
useful
not useful
thank you very muck Peter

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.