]
>
Assignment 1: Object Code (Due: Th, April 3)
Assignment 1: Object Code (Due: Th, April 3)
Write an interpreter for MINI-MACHINE programs . The invocation to the
interpreter should provide the name of a program file and the name of a data
file.
Program Files
A MINI-MACHINE program file should consist of
An integer value BR specifying the length of the program.
The code of the program made up of BR integer values.
The Interpreter
The interpreter should be a program that
Reads the value of the base register BR
Loads a MINI-MACHINE program into MEM[0], MEM[1], MEM[2],… ,
MEM[BR-1]
Executes the program.
The execution starts by initializing LC to zero and then repeatedly doing the
following.
Assign to variables OPR, OP1, OP2, and OP3 the values of MEM[LC],
MEM[LC+1], MEM[LC+2], and MEM[LC+3], respectively.
Increase LC by 4.
Execute the operation code OPR on the operands OP1, OP2, and OP3.
Requirements
Write your code in Java, C++, or C, unless you know how to handle LEX
and YACC with other languages (see lab 6 ).
Use the ‘submit c756aa lab1 file1 file2 ...’ command to submit your lab.
Assignments are due at midnight of due date.
KEEP the files of your program until the end of the course, since you will
need it again later or in the project.