User Tools

Site Tools


mbstring extension must be loaded in order to run mPDF
sd:sd-8516_extended_register_layout

SD-8516 Extended Register Layout

As it stands now (June 2026)

  • There are sixteen 16-bit registers: A, B, C, D, E, F, G, I, J, K, L, M, T, X, Y, Z.
  • The low and high bytes can be accessed via (ex.) AL and AH.
  • A 24 bit pointer can be created by using special combinations such as BLX, ELM, FLD, and so on.
  • A 32 bit combined register can be created by using special combinations such as AB, CD, XY, etc.

In addition to the above there are deprecated test registers (don't use these):

  • b0..b7 – byte registers
  • w0..w7 – word registers
  • p0..p7 – 24 bit pointer registers
  • d0..d7 – double word (32 bit) registers
  • q0..q7 – quad word (64 bit) registers
  • s0..s7 – 128 bit registers

The deprecated test registers are singular; no byte access exists, no LUI, etc. I found this to be strange and I didn't like the idea of them, so I never used them.

However, no end of problems arose using the 24 bit ELM/etc. and the 32 bit AB/CD. the concept was solid, and was used on other processors of the era. The issue is that it's a needless concession that only gums things up.

Instead, we could keep the existing system but add:

  • AX..ZX (including XX) as 32 bit “x” registers. The low word is the A, etc.
  • EA is the high doubleword. So then we have EA, EB, EC, etc. as an additional 16 x 32 bit registers. You may wonder why we need 32×32 bit registers. Well we don't, but then we combine them as EAX, EBX etc. for a 64 bit register.

This removes the need to pair 16 bit registers in a way that clobbers them.

   0    1    2    3    4    5    6    7
  AL   AH
  -- A --
  ------- AX ------   ------ EA -------
  --------------- EAX -----------------

This allows E registers to be used as 32 bit pointers without using a code (AL/AH, A, or AX) register. It also means 64 bit registers are easier to use. Currently its ABCD or nothing, which gets a bit odd.

I haven't implemented this, but I might. I mean, the current system works.. and, as they say, everything is a tradeoff.

What happens to the 24 bit pointers? They get removed. Eventually. The fact is, this isn't real hardware. There's no reason to use a 24 bit pointer.

sd/sd-8516_extended_register_layout.txt · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki