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)