REGISTERS

The CPU is a very register-oriented design, so there are quite a few registers accessible. (There are some internal work registers as well, but these are invisible to the architecture side of things.) There are eight 16-bit general-purpose registers, the first four of which can be accessed as separate eight-bit registers; these comprise the General Register Block. There are also three 8-bit segment-selector registers (more on them in the Addressing page) and one 8-bit status register, which comprise the Special Register Block. Finally, there is one 16-bit stack pointer and one 16-bit program counter; these are not grouped into a register block.

General Register Block
AL, AH, BL, BH, CL, CH, DL, DH  8-bit general-purpose registers
AX, BX, CX, DXConcatenated 16-bit general-purpose registers
EX, FX, GX, HX16-bit general-purpose registers

Special Register Block
CS, DS, SS  8-bit segment selectors
SF8-bit status register

Other registers
SP16-bit stack pointer
PC16-bit program counter

Only the registers in the General Register Block can be accessed by most instructions; however, there are instructions to transfer to and from the registers in the Special Register Block and the stack pointer. The program counter cannot be accessed as a register by any instruction. The registers in the General Register Block are indicated in the instruction post-byte by a corresponding number:

ALAHBLBHCLCHDLDH
01234567
AXBXCXDXEXFXGXHX
89ABCDEF

Similarily, the registers in the Special Register Block have corresponding numbers for the instructions that access them:

CSDSSSSF
0123

The SF status register contains various status flags indicating the results of the different operations. It also contains the Interrupt Mask bit, which disables interrupts 0 through 5 when set.

FlagNZCOIAUE
Bit76543210

NNegative resultZZero resultCArithmetic carryOArithmetic overflow
IInterrupt maskAAddress exceptionUOpcode exceptionEEven result