CMSC212 - Project #1
Header, Source, Object, and Sample Data Files
Use CVS to get the files.
Updates on project 1B.
There are no commas between operands (as one example in the handout implied).
There is a Data pseudo that allows a programmer to specify the entire contents of a 32 bit word. The syntax is:
which would fill the corresponding memory location with the value 123,456.
Assemble should return -1 if there is any error in the file. On sucess it should return the number of word of memory assembled (including any Data pseudo ops).
The program counter (R1) should be advanced prior to the execution of an instruction. For example, if you are running the instruction at memory location 1, while executing that instruction the PC should be 2. The Output instruction should print a newline after the integer.
Your assembler should check for valid assembly files. Here is a list of the types of errors you should be able to detect. This is not exhaustive, but should get you thinking about the types of errors that can occur in an assmebly program.
Labels that are used with an instruction, but not defined (i.e. label: missing).
Invalid op codes
Missing or Invalid operands
Invalid Memory address specified (out of the range 0-65535).
Invalid Register numbers specified
Assmebly file not found
Your assmebler needs to process any valid input which includes sequences of multiple spaces or tabs in the input to seperate operands, labels, or before the operator.