+{-# LINE 149 "PolyAlu.lhs" #-}
+{-# ANN initstate InitState#-}
+initstate :: RegState D9 Word
+initstate = State (copy (0 :: Word))
+
+{-# ANN program TestInput#-}
+program :: [(Opcode, Word, Vector D4 Word, RangedWord D9, RangedWord D9, Bit)]
+program =
+ [ (Low, 4, copy (0::Word), 0, 0, High) -- Write 4 to Reg0, out = 0
+ , (Low, 3, copy (0::Word), 0, 1, High) -- Write 3 to Reg1, out = Reg0 + Reg0 = 8
+ , (High,0, copy (3::Word), 1, 0, Low) -- No Write , out = 15
+ ]
+
+run func state [] = []
+run func state (i:input) = o:out
+ where
+ (state', o) = func i state
+ out = run func state' input
+
+main :: IO ()
+main = do
+ let input = program
+ let istate = initstate
+ let output = run actual_cpu istate input
+ mapM_ (\x -> putStr $ ("# (" P.++ (show x) P.++ ")\n")) output
+ return ()