Lesson 0 / Assy 101

Roger Heflin rah at horizon.hit.net
Fri May 28 14:36:09 GMT 1999



On Fri, 28 May 1999, Marc Randolph wrote:

> 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,
> 

On my larger code changes, I have put in a jump to the replacement
code, and then jump back to the address after the jump out.  I make
sure the code I jump to did do what the statement I replaced with the
jump did plus the function changes.   I have done 5-6 changes like
this.  I have also done 1 change like Marc mentioned above, but is was
for something much simpler where I just modified the opcode (changed
BLT to BNE).   I really see it as too dangerous to attempt to
reassembly all of the code, I feel much better about putting in jump
patches and not messing with all of the code.


			Roger




More information about the Gmecm mailing list