NEC V30MZ registers
From WSdev Wiki
Jump to navigationJump to search
- Four 16-bit general-purpose registers, with their (low, high) components accessible as individual 8-bit sub-registers:
- AXAW (AL, AH) - the accumulator register,
- BXBW (BL, BH) - the base register,
- CXCW (CL, CH) - the count register,
- DXDW (DL, DH) - the data register,
- Four additional 16-bit registers:
- SIIX - the source index register,
- DIIY - the destination index register,
- SP - the stack pointer; the stack is always addressed in the stack segment (so as
SS:SP
far addresses), - BP - the base pointer.
- Four segment registers:
- CSPS - the code segment,
- DSDS0 - the data segment,
- ESDS1 - the extra segment; an additional data segment,
- SS - the stack segment.
- IPPC - the instruction pointer; instructions are always addressed in the code segment (so as
CS:IP
far addresses), - FLAGSPSW - the 16-bit processor flag register.
While the eight registers can be used in a general-purpose manner, some opcodes are constrained to only using certain registers:
- AX benefits from more compact encoding for certain instructions; it's also used as an output and input register in multiplication/division, port access, BCD conversions, and (as AL) in the XCHG opcode.
- CX is used for loop and repeat instructions as a counter.
- DX can be used used as the address register for port access, it is also used as an output register for word multiplication/division.
- BX, SI, and DI can be used as indices for accessing data in tables in the DS segment (or other segments when overridden).
- SI and DI are, in addition, used as source and destination pointers by string instructions.
- Similarly, BP can be used as an index for accessing stack data; this makes it particularly useful as a frame pointer.