Thanks to Jeff Shafer at the University of the Pacific for inspiration.
MARIE assembly language programs are saved in ".mas" files (which are plain text). Use "File -> Edit" to open assembly language editor in MARIE simulator.
Download Ex4_1.mas, or copy it from the unzip folder to your Desktop or other personal folder. Use "File -> Edit" to open the editor. Use "File -> Open" (from the editor window) to open Ex4_1.mas in the MARIE editor.
MARIE command line:
Label, opcode operands / comments
Instructions for assembler:
In editor window, use "Assemble -> Assemble Current File". This will produce several files, one of which is the ".mex" file that contains machine code the simulator can use.
In editor window, use "Assemble -> Show assembly listing". What do you see? What are the references for the symbol "One"?
In simulator window, use "File -> Load" and select .mex file from previous step.
Run the program, identify what all the sub-windows do, particularly the window on the bottom.
Use "Run -> Set stepping mode -> On" and restart ("Run -> Restart") the program simulation, this time using the "Step" button to watch changes one step at a time.
With a partner or on your own, write and run a complete MARIE assembly program
to do this:
if Y > X then Y = Y - 5; else X = X + Y;