BRA syntax?
#1
Supreme Member
Thread Starter
BRA syntax?
From what I can tell. BRA $xxxx will work and the assembler will calc the offset and put it into a +-128d for you correct?
But how do you do it if your not sure of the exact address?
BRA #xxx?
The pink book says 2's complement???
I'm slowly working on relocatable code so I need to change all the Bxx/jmp's to the numerical offset I think.
But how do you do it if your not sure of the exact address?
BRA #xxx?
The pink book says 2's complement???
I'm slowly working on relocatable code so I need to change all the Bxx/jmp's to the numerical offset I think.
#2
Moderator
iTrader: (1)
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,406
Likes: 0
Received 216 Likes
on
202 Posts
Car: check
Engine: check
Transmission: check
You really want to use labels. Counting bytes and changing them everytime the code is touched is error prone. With labels the code will still be relocatable as a BRA is relative to the current PC register.
The max distance for a BRA is +127 bytes and -128 bytes. A backwards BRA is in 2's complement. A forward BRA is in direct bytes.
RBob.
The max distance for a BRA is +127 bytes and -128 bytes. A backwards BRA is in 2's complement. A forward BRA is in direct bytes.
RBob.
#3
Supreme Member
iTrader: (2)
Join Date: Jan 2002
Location: Moorestown, NJ
Posts: 9,962
Likes: 0
Received 3 Likes
on
3 Posts
Car: 88 Camaro SC
Engine: SFI'd 350
Transmission: TKO 500
Axle/Gears: 9-bolt w/ 3.23's
Yep. Labels are your friend, as well as the pseudo mneumonic, ORG available in most assemblers. With all lables and origins of teh code fixed, you can make widespread changes and just assemble the code. The compiler will do all the addresses and offsets automatically.
Thread
Thread Starter
Forum
Replies
Last Post
Eggplant Jeff
Auto Detailing and Appearance
13
01-02-2002 12:00 AM