import Data.Int
-- regs, as seen by the programmer
-data Reg = B | C | D | E | H | L | PHL | A deriving Eq
+data Reg = B | C | D | E | H | L | PHL | A | IXH | IXL | IYH | IYL deriving Eq
-- reg pairs specified in the z80 manual
-data BC = BC
-data DE = DE
-data HL = HL
-data SP = SP
-data AF = AF
-data IX = IX
-data IY = IY
+data BC = BC deriving Eq
+data DE = DE deriving Eq
+data HL = HL deriving Eq
+data SP = SP deriving Eq
+data AF = AF deriving Eq
+data IX = IX deriving Eq
+data IY = IY deriving Eq
-- sets of reg pairs used in the z80 manual
data RegPair a b c d = R1 a | R2 b | R3 c | R4 d deriving Eq
H -> "h"
L -> "l"
PHL -> "(hl)"
+ IXH -> "ixh"
+ IXL -> "ixl"
+ IYH -> "iyh"
+ IYL -> "iyl"
instance Show BC where show BC = "bc"
instance Show DE where show DE = "de"
OUT_PC_R r -> "out (c)," ++ show r
OUT_PC_Zero -> "out (c),0"
OUTI -> "outi"
- OUTIR -> "outir"
+ OUTIR -> "otir"
OUTD -> "outd"
- OUTDR -> "outdr"
+ OUTDR -> "otdr"
-- illegal
IllegalInstruction s -> "db " ++ s