I would do something like the following:
Create a map between instruction numbers and instructions.
Load the instructions into the map.
Create another map between "memory" locations and text representations of their values.
Have a variable to store the current instruction.
Have an instruction processor based on what counts as a valid statement.
|