Safe Haskell | None |
---|---|
Language | Haskell98 |
- type Trace = [State]
- wordAll :: Instrs -> State -> [State]
- word :: Instrs -> State -> State
- stepAll :: State -> [State]
- step :: State -> State
- traceAll :: State -> Trace
- traceProgram :: State -> Trace
- stepProgram :: State -> Trace
- eval :: State -> State
- runNativeProgram :: State -> NativeProgram -> State
- countTime :: Trace -> Double
- throttle :: Int -> Trace -> Either Trace Trace
- endWord :: Opcode -> Bool
- run :: Opcode -> [State] -> [State]
- execute :: Opcode -> State -> State
- jump :: Opcode -> F18Word -> State -> State
Documentation
wordAll :: Instrs -> State -> [State] Source
Runs a single word's worth of instructions starting from the given state, returning the intermediate states for each executed opcode.
word :: Instrs -> State -> State Source
Runs a single word's worth of instructions, returning only the final state.
stepAll :: State -> [State] Source
Executes a single word in the given state, incrementing the program counter and returning all the intermediate states.
Executes a single word in the given state, returning the last resulting state.q
traceProgram :: State -> Trace 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 -> Trace 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 -> State Source
Executes the specified program on the given state until it hits a "terminal" word--a word made up of four nops or all 0s.
throttle :: Int -> Trace -> Either Trace Trace Source
Checks that the program trace terminated in at most n steps, returning Nothing otherwise.
run :: Opcode -> [State] -> [State] Source
Extends the given trace by a single execution step. The trace cannot be empty.