Safe Haskell | None |
---|
- word :: Instrs -> State -> State
- step :: State -> State
- traceProgram :: State -> [State]
- stepProgram :: State -> [State]
- eval :: State -> State
- runNativeProgram :: State -> NativeProgram -> State
- countTime :: [State] -> Double
- throttle :: Int -> [State] -> Either [State] [State]
- endWord :: Opcode -> Bool
- execute :: Opcode -> State -> State
- jump :: Opcode -> F18Word -> State -> State
Documentation
word :: Instrs -> State -> StateSource
Runs a single word's worth of instructions starting from the given state.
Executes a single instruction in the given state, incrementing the program counter.
traceProgram :: State -> [State]Source
Returns a trace of the program's execution. The trace is a list of the state of the chip after each step.
stepProgram :: State -> [State]Source
Trace a program until it either hits four nops or all 0s.
Runs the program unil it hits a terminal state, returning only the resulting state.
runNativeProgram :: State -> NativeProgram -> StateSource
Executes the specified program on the given state until it hits a terminal word--a word made up of four nops or all 0s.