diff options
Diffstat (limited to 'include/z80.h')
-rw-r--r-- | include/z80.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/include/z80.h b/include/z80.h index ab095d8..c9bd107 100644 --- a/include/z80.h +++ b/include/z80.h @@ -56,20 +56,30 @@ typedef signed char Z80Relative; typedef unsigned short Z80Word; -/* A Z80 16-bit register. To access the HI/LO component use the indexes - Z80_HI_WORD and Z80_LO_WORD which will be initialised once Z80Init has been - called. +/* A Z80 16-bit register made up of 2 8-bit registers. */ +#ifdef Z80_LITTLE_ENDIAN +typedef struct +{ + Z80Byte lo; + Z80Byte hi; +} Z80RegPair; +#endif + +#ifdef Z80_BIG_ENDIAN +typedef struct +{ + Z80Byte hi; + Z80Byte lo; +} Z80RegPair; +#endif + typedef union { Z80Word w; - Z80Byte b[2]; + Z80RegPair b; } Z80Reg; -extern int Z80_HI_WORD; -extern int Z80_LO_WORD; - - /* The processor */ struct Z80Private; |