ZXS: Decode: Fix index parameter
authorLucian Mogosanu <lucian.mogosanu@gmail.com>
Tue, 23 Dec 2014 17:40:49 +0000 (19:40 +0200)
committerLucian Mogosanu <lucian.mogosanu@gmail.com>
Tue, 23 Dec 2014 17:40:49 +0000 (19:40 +0200)
src/ZXS/Decode.hs

index 1b21657..ddb4dc4 100644 (file)
@@ -90,7 +90,7 @@ decode = do
         0 -> return . POP_QQ $ decodeRegPair_qq p
         1 -> if p > 3
           then return . IllegalInstruction $ "decode: opcode = " ++ show b
-          else return $ [ RET, EXX, JP_HL, LD_SP_HL ] !! fromIntegral y
+          else return $ [ RET, EXX, JP_HL, LD_SP_HL ] !! fromIntegral p
       -- z = 2
       2 -> do
         lb <- fetch