pgmfi.org

Hacking up Honda's ECU
It is currently Mon Dec 09, 2024 3:55 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Sun Feb 29, 2004 5:37 pm 
I am trying to understand how the LRB (Local Register Base) is manipulated and how it effects the off N8 in jump commands. I have read AlkOn's text in the "using "off" in asm" thread, but do not quite understand the basics of it all.

Looking at this example:
MOV LRB, #0021
"This instruction transfers the contents og the addressing object (word long) to the local register base (LRB)."
In other words the LRB is now set to 0021.
Where will the PC look for the bit in the following "Jump if Bit Reset" instruction?
JBR off 28.3, 044D
How would it affect the LRB if the value #0021 was #1555?
I know that some disassemblers track these numbers, but can someone explain the basics of the LRB's function?

Thank you!

[%sig%]

Post Edited (03-03-04 18:52)


Top
  
Reply with quote  
PostPosted: Sat Mar 06, 2004 11:01 am 
AlkOn was very helpfull here and explained to me how this works.
I don't know if anyone will find this interresting but here goes:

If hex #0037 is loaded into the LRB via MOV instruction, the 16 bits of the LRB is set to:

0000000000110111

The off Base (YY) is set by bit no. 12 to 5, so if we split it up:

15-13 12-5 4-0
000 | 00000001 | 10111
off Base Reg. Base

The value of bit 12 to 5 will set the value of the two upper byte (YY) of the off Base. In this case the value (YY) is 1, so therefore the off Base will be 0100.

If an instruction calls for an "off XX #35EF" (i.e. A5) the correct memory reference in the case will be "01A5 #35EF".

The first 5 bits (4 to 0) of the LRB set the value of the Register Base. In this case the hex value of the 5 bits will be "17" as a result of bits 10111. Each Register bank contain 8 bytes (r7 to r0). Hex 17 is therefore multiplied by 8 to find the correct Register Base address. (hex 17 * 8 = B6) This value is added to the off Base to generate the Register Base hex address. In this example the Register Base will be set to 01B6. The register will then be set like this:

r0 @ 01B6
r1 @ 01B7
r2 @ 01B8
r3 @ 01B9
r4 @ 01BA
r5 @ 01BB
r6 @ 01BC
r7 @ 01BD

I'm not sure all values are correct since a had no calculator to work on. :)

[%sig%]

Post Edited (03-08-04 14:23)


Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 29, 2005 8:13 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Just checking up on your math.. I tried to follow what you were doing and I came up with a different number..

Hex 17 (Decimal 23)*8 = B8 (Decimal 184).

Am I correct in this??

If so, here's a cheater calc for decrypting R0 to R7 in Honda bins that rely on the above information...


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 28, 2005 3:00 am 
How do you type numbers into this thign?


Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 30, 2005 1:38 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Click in the box under MOV, LRB XXXX and click Calculate..


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 30, 2005 2:15 pm 
HAhaha ya, I got that. :P

..it doesn't really accept my input though.. It's like it's random when it accept my values (yes, I'm typing hex).


[EDIT]
Hrm, apparently, I can only type in one value.. hit calculate, then I have to clos ethe app and reopen it.

That'll work, thanks Dan. ..hit me up on MSN, and we'll work asm. :D
[/EDIT]


Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 30, 2005 10:33 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
umm... you can use 'backspace' there too :P


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 30, 2005 11:30 pm 
You should edit that post to say, "You have to use backspace".

Otherwise, you can't overwrite the numbers.


Top
  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 13, 2005 9:42 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
Hey... where the FÇÇÇ did my calculator go... ???


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 14, 2005 4:06 am 
Offline

Joined: Fri Sep 17, 2004 10:34 am
Posts: 638
Location: Sofia, Bulgaria
Dan, I remember reading that some time back, but then it was all just Blah-ha-haaaa
it's very helpful now.... the docs are starting ti make more sense now....
thank you ALL


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 14, 2005 2:53 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
I made a new calc, but can´t upload it. will see what happens later this week. Good luck, hope you figure everything out.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jan 02, 2006 2:05 am 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
My LRB Calc


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 03, 2006 8:14 am 
Offline

Joined: Fri Sep 17, 2004 10:34 am
Posts: 638
Location: Sofia, Bulgaria
I honestly don't know what you're calculating.....
entering "21" yelds some strange things.... could you explain the fields a bit
lrb=21 should set offset addressing to start at 0x100
and r0 to be at 0x108
and I don't see anything like this in your calculator
:shock:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jan 07, 2006 2:38 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
you don't normally 'set' LRB with a byte. it is normally set with a word.

setting LRB to 0021 gets you this:


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 08, 2006 7:02 am 
Offline

Joined: Fri Sep 17, 2004 10:34 am
Posts: 638
Location: Sofia, Bulgaria
ok... issue resolved :)
so i forgot to enter the MSB zeros :oops:
anyway, good progie, just work a bit on that string->hex function... 0x21 and 0x0021 is the same thing ;)
yeah, I'm and ass.....


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group