Description
An LC4 assembly interpreter in Haskell. For the 240 kids to use hopefully.
Team
- Github repo is at: https://github.com/johnpmayer/lc4sim
- Trello is used for collaboration amongst current devs at:
https://trello.com/board/lc4sim/4ed3e6e4aebfc0d21d0ee596
Stages
Load
- read x.asm
- parse
- loader
- vmstate
Run
Breakpoint? No -> End Yes -> commandline waiting
Step
vmstate step
- register file
- current stack?
- pc
- instruction
- trace?
Modules
lc4parser
Parses LC4 assembly file into lc4env data structures to be used in rest of program.
lc4vm
The data type definitions of the LC4 environment, as well as associated data structures used to represent state.
The PC is going to be represented with line numbers. Comments are considered as NOPs. As long as the invariant holds internally, the OS will not clobber R7 accidentally.
simulator
- Performs the interpretation and altering of state.
lc4PP
The LC4 pretty printer.
main
Parses command line args and executes program components. This is where the REPL lies.
Parser
The parser module that parses generic strings. Works with ParserCombinators.
vmloader
Takes a parsed .asm file and loads the appropriate values into the LC4 virtual machine. Instantiates a new VM for the simulator.