BRA syntax?
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.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
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.
Supreme Member
iTrader: (2)
Joined: Jan 2002
Posts: 9,962
Likes: 5
From: Moorestown, NJ
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
Jan 2, 2002 12:00 AM





