Lesson 0 / Assy 101

Marc Randolph mrand at pobox.com
Fri May 28 14:06:34 GMT 1999


On Wed, May 26, 1999 at 04:37:46PM -0600, Steve Ciciora wrote:
> >> So, what exactly do you want to learn?  
> run it through a disassembler, and then be able to re-assemble it and burn
> a ROM.  So the origional and new one are identical.  Then, I can play with
> making a few changes, etc.  Not that what I want to do is 'necessary', but
> I would like to have that ability.  I can read eproms, burn some, I just
> don't have a disassembler or assembler for the GM versions of 6811.  What
> was mentioned about changing configuration tables for disassemblers sounded
> _way_ cool.  

Steve, 

Sorry it took so long to respond - had to put out some fires in the
lab.

I don't know about the other people making code changes, but I don't
reassemble the code since I don't make major changes.  All I do is 
change the bytes for either the op code or the argument(s).  For 
example:

My car has a shift light.  Unfortunately, it comes on WAY too early,
probably because GM used rpm/25 to figure out when it comes on.
I want it to come on at about 6800 rpm, which is out of the range of
rpm/25 (hex FF = 255 decimal.  255 * 25 = 6375 rpm).  So, I 
changed the data at location D802:

D801 96 E0          LDAA  $E0     % Put engine rpm (rpm/25) into AccumA
D803 CE 853D        LDX   #$850B  % Put 0x853D into regX

to 

D801 96 E1          LDAA  $E1     % Put engine rpm (rpm/31.25) into AccumA
D803 CE 853D        LDX   #$850B  % Put 0x853D into regX

For those that are interested, the above two lines of code do the 
following:

AccumA = GetEngineSpeedDividedBy31_25();
regX = FIRST_ENTRY_OF_SHIFT_LIGHT_TABLE;  /* The first entry is at 0x850B */

In other words, $E1, in this PROM, is the engine rpm / 31.25.
The code reads the current rpm so it can made a decision if the
shift light should be turned on.  It decides this by (later) comparing
the current rpm to an entry in the table for the shift light.  As
others have mentioned, Accumulator A and register X can be thought of
as temporary storage locations.

The 96 in the listing above is the op code for LDAA, and CE is the op
code for LDX.  Changing these values will change the operation that the
program is performing - something you don't normally want to do (as if
editing the rest of the program is something you normally want to do).

Enjoy,

   Marc

-- 
  Marc Randolph     -    mrand at pobox.com    -     PGP keyID: 0x4C95994D



More information about the Gmecm mailing list