
CPSC 2105 Lab 2 Wednesday, March 22, 2006
This lab must be completed on or before Wednesday, March 29.
The following MARIE assembly language program is based on a previous homework
assignment, with one instruction added (the Output just before the Halt). The program is
written in proper MARIE format, without hexadecimal addresses being specified.
You are to edit, assemble, and execute the program.
NOTE: 1. All labels are followed by a comma, so that we have “A,” for label A.
2. All constants are identified with the pseudo–op HEX.
Load A
Add One
Jump S1
S2, Add One
Store A
Halt
S1, Add A
Jump S2
A, HEX 0023
One, HEX 0001
STEPS:
1. Start the MARIE simulator by clicking on the icon. Ignore the DOS command
prompt window and focus on the window titled “MARIE Simulator”.
2. Click File / Edit to start the MARIE Editor.
3. Enter the above program and save it on your H drive. The file extension is set
as “.mas”. Use a meaningful file name, such as “CPSC2105_Lab02”.
4. Assemble the file by clicking Assemble / Assemble Current File on the menu
of the MARIE Editor. Correct any errors found and assemble until no errors.
5. View the assembly listing by clicking Assemble / Show Assembly Listing on
the menu of the MARIE Editor. Print the assembly listing and hand it in.
6. Close the MARIE Editor and return to the MARIE Simulator.
7. Load the file just assembled by selecting File / Load from the MARIE Simulator
menu. The file will be located on your H drive with an “.mex” extension.
8. Run the file just assembled by selecting Run / Run from the MARIE Simulator
menu. Note what is produced in each window.
9. List the contents of each non–zero memory location in the memory map.
List the contents of each register and the Output window.
Hand in the assembly listing and the contents of memory and registers.