git @ Cat's Eye Technologies UampirNexol / f8cfa3d
No catch-all in extraction cases. Chris Pressey a month ago
1 changed file(s) with 17 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1717 extract :: Expr -> [Int]
1818
1919 extract (Apply LDA_i (IntLit i)) = [0xa9, fromIntegral i]
20
21 extract (Apply LDA_i other) =
22 error $ "invalid argument to LDA#: " ++ (show other)
23
24 extract (Apply other _arg) =
25 error $ "invalid application: " ++ (show other)
26
2027 extract TAX = [0xaa]
2128 extract TAY = [0xa8]
2229 extract CLC = [0x18]
5057 in
5158 c1 ++ [offset1] ++ f ++ c2a ++ [offset2a] ++ c2b ++ [offset2b] ++ t
5259
53 extract other =
54 error $ "unsupported for extraction: " ++ show other
60 extract (Bind _ident _expr _body) = error "TODO"
61 extract (VarRef _ident) = error "TODO"
62
63 extract Skip = []
64
65 extract t@LDA_i =
66 error $ "unsupported for extraction: " ++ (show t)
67
68 extract t@(IntLit _) =
69 error $ "unsupported for extraction: " ++ (show t)
5570
5671 extractCond (IsSet Z) = [0xf0] -- BEQ
5772 extractCond (IsSet N) = [0x30] -- BMI