DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

BRA syntax?

Thread Tools
 
Search this Thread
 
Old 02-26-2005, 12:40 PM
  #1  
Z69
Supreme Member

Thread Starter
 
Z69's Avatar
 
Join Date: Sep 2003
Location: Texas
Posts: 1,409
Likes: 0
Received 1 Like on 1 Post
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.
Old 02-26-2005, 01:49 PM
  #2  
Moderator

iTrader: (1)
 
RBob's Avatar
 
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.
Old 02-26-2005, 06:14 PM
  #3  
Supreme Member

iTrader: (2)
 
dimented24x7's Avatar
 
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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
sublimepennywise
Aftermarket Product Review
8
08-25-2002 08:29 PM
LottaBallsCamaro
History / Originality
3
02-04-2002 06:38 PM
Eggplant Jeff
Auto Detailing and Appearance
13
01-02-2002 12:00 AM
Joe_L
Auto Detailing and Appearance
10
12-31-2001 01:29 AM



Quick Reply: BRA syntax?



All times are GMT -5. The time now is 01:46 AM.