type AluOp = Bit
-alu :: (AluOp, Bit, Bit) -> Bit
-alu (High, a, b) = a `hwand` b
-alu (Low, a, b) = a `hwor` b
+alu :: AluOp -> Bit -> Bit -> Bit
+alu High a b = a `hwand` b
+alu Low a b = a `hwor` b
type ExecState = (RegisterBankState, Bit, Bit)
exec :: (RegAddr, Bit, AluOp) -> ExecState -> (ExecState, ())
where
(reg_s, t, z) = s
(reg_s', t') = register_bank (addr, Low, DontCare) reg_s
- z' = alu (op, t', t)
+ z' = alu op t' t
s' = (reg_s', t', z')
-- Write