MIPS Assembler


The MIPS Assembler (cs241.binasm) translates a MIPS assembly language program into a MIPS machine language binary file suitable for use by the mips.twoints and mips.array frontends to the MIPS emulator. The assembler reads the assembly language source text from standard intput, and outputs the machine language binary to standard output. Any error or warning messages are sent to the standard error stream.


To assemble the file inttest.asm and write out the MIPS binary inttest.mips, then run it with mips.twoints:
java cs241.binasm < inttest.asm > inttest.mips
java mips.twoints inttest.mips

To assemble the file arraytest.asm and write out the MIPS binary arraytest.mips, then run it with mips.array:

java cs241.binasm < arraytest.asm > arraytest.mips
java mips.array arraytest.mips