array-forth- A simple interpreter for arrayForth, the language used on GreenArrays chips.

Safe HaskellNone




data Addr Source


data Instruction Source

Represents a single instruction as viewed by the synthesizer. This can be an opcode, a numeric literal or a token representing an unused slot.

type Program = [Instruction]Source

A program to be manipulated by the MCMC synthesizer

readInstruction :: String -> Either ParseError InstructionSource

Tries to parse the given string as an instruction, which can either be a number, an opcode or _ representing Unused.

readProgram :: String -> Either ParseError ProgramSource

Reads a program in the synthesizer's format.

fromNative :: NativeProgram -> ProgramSource

Gets a synthesizer program from a native program. Currently does not support jumps.

runProgram :: State -> Program -> StateSource

Runs a given program from the default starting state.

load :: Program -> State -> StateSource

Loads the given synthesizer-friendly program into the given state.