git @ Cat's Eye Technologies ZOWIE / 82e9bb7
Hello, world! At least that. That, at least. Chris Pressey 11 months ago
2 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
00 module Language.ZOWIE.Registers where
11
2 import Data.Char (chr)
3
24 import Language.ZOWIE.State
5
36
47 data Register = TtyRegister
58 | BeginTransactionRegister
4144 writeAddr state@State{ mem=mem } addr payload =
4245 case mapRegister addr of
4346 TtyRegister -> do
44 print payload
47 putChar $ chr $ fromIntegral payload
4548 return state
4649 BeginTransactionRegister ->
4750 return $ beginTransaction state
1919 text <- readFile fileName
2020 let prog = Parser.parseZOWIE text
2121 result <- Machine.loadAndRun prog
22 putStrLn $ show $ result
22 -- putStrLn $ show $ result
2323 return ()
2424 _ -> do
2525 abortWith "Usage: zowie (parse|run) <zowie-program-filename>"