Question: Your assignment is to write an assembler for a subset of the MIPS instruction set. It should read the assembly file from standard input and
Your assignment is to write an assembler for a subset of the MIPS instruction set. It should read the assembly file from standard input and write the machine code to standard output.
You can assume that an assembly file will have instructions preceding data and the general format of a file will be as follows:
.text .data
.data
Each instruction or data can have a symbolic label. Each assembly line can have a comment starting with the # character, which indicates a comment until the end of the line. You can assume that the maximum number of instructions is 32768 and the maximum number of data words is also 32768. You can also assume the maximum length of an assembly line is 80 characters and the maximum size of a symbolic label is 10 characters. Finally, you can assume there are no whitespace (blank or tab) characters between the arguments in each assembly instruction.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
