0

enter image description here enter image description here

Above sic/xe code,

I don't understand translate process.

105F LDT LENGTH => 774000

1056 EXIT STX LENGTH => 134000

I already know translate opcode and 000.

But I don't know how can I get 4.

Please give me kind explanation.

Heikki
  • 2,214
  • 19
  • 34
oldkrak
  • 47
  • 5
  • 4 is the `x b p e` bits. This instruction is using the 12 bit displacement from the B register addressing mode, which is defined as `0 1 0 0`. `B` has been previously set to `#LENGTH` hence the offset is zero. – Jester Oct 27 '20 at 14:53
  • Then, why this instruction do not have `4`? `0023 STA LENGTH 0F200D` – oldkrak Oct 27 '20 at 16:13
  • There are multiple addressing options. For that, the assembler chose to use `0 0 1 0` which is 12 bit signed displacement from PC. Note that the instructions you first asked are above address 1000 hence out of range for a 12 bit PC relative offset. – Jester Oct 27 '20 at 19:26
  • Thank you sir. I understand base-relative. But I still don't understand PC relative range. I guess the range of PCs available is 0000 < PC < 1077 ? So if we go beyond this range, we use the base-relative? – oldkrak Oct 28 '20 at 02:48
  • PC relative is relative to the address of the current instruction where you use it. It's just a number added to the PC. – Jester Oct 28 '20 at 13:42

0 Answers0