The use of the LRB and off.

pelz

#1 β—ˆ 2024-12-09

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)

pelz

#2 β—ˆ 2024-12-09

Re: The use of the LRB and off.

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)

Ltdannear

#3 β—ˆ 2024-12-09

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

TurboEF9

#4 β—ˆ 2024-12-09

How do you type numbers into this thign?

Ltdannear

#5 β—ˆ 2024-12-09

Click in the box under MOV, LRB XXXX and click Calculate..

TurboEF9

#6 β—ˆ 2024-12-09

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]

Ltdannear

#7 β—ˆ 2024-12-09

umm... you can use 'backspace' there too :P

TurboEF9

#8 β—ˆ 2024-12-09

You should edit that post to say, "You have to use backspace".

Otherwise, you can't overwrite the numbers.

Ltdannear

#9 β—ˆ 2024-12-09

Hey... where the FÇÇÇ did my calculator go... ???

1net

#10 β—ˆ 2024-12-09

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

Ltdannear

#11 β—ˆ 2024-12-09

I made a new calc, but canΒ΄t upload it. will see what happens later this week. Good luck, hope you figure everything out.

Ltdannear

#12 β—ˆ 2024-12-09

My LRB Calc

1net

#13 β—ˆ 2024-12-09

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:

Ltdannear

#14 β—ˆ 2024-12-09

you don't normally 'set' LRB with a byte. it is normally set with a word.

setting LRB to 0021 gets you this:

1net

#15 β—ˆ 2024-12-09

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