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 Feb 26, 2005 | 12:40 PM
  #1  
Z69's Avatar
Z69
Thread Starter
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
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.
Reply
Old Feb 26, 2005 | 01:49 PM
  #2  
RBob's Avatar
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.
Reply
Old Feb 26, 2005 | 06:14 PM
  #3  
dimented24x7's Avatar
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.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
sublimepennywise
Aftermarket Product Review
8
Aug 25, 2002 08:29 PM
LottaBallsCamaro
History / Originality
3
Feb 4, 2002 06:38 PM
Eggplant Jeff
Auto Detailing and Appearance
13
Jan 2, 2002 12:00 AM
Joe_L
Auto Detailing and Appearance
10
Dec 31, 2001 01:29 AM
IROCME
Body
0
Dec 23, 2001 07:09 PM




All times are GMT -5. The time now is 04:39 AM.