CS 241 -- Winter 2011 -- Assignment 4

Submission deadline:
Friday, February 4, 2010 at 5:00 pm

Reminder: For this and future assignments, be sure to run the command source /u/cs241/setup to gain access to the CS 241 tools.

Assignment 4

Assignment 4, Problem 1 (9 marks out of 60; filename: Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle jr and jalr instructions.

Other than the inclusion of jr and jalr instructions, the restrictions, assumptions, and output requirements are as stated in assignment 3, problem 5.

Assignment 4, Problem 2 (9 marks out of 60; filename Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle add, sub, slt, and sltu instructions.

Other than the inclusion of add, sub, slt and sltu instructions, the restrictions, assumptions, and output requirements are as stated in problem 1.

Assignment 4, Problem 3 (9 marks out of 60; filename: Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle beq and bne instructions with an integer or hex constant as the branch offset.

Other than the inclusion of instructions containing beq and bne operands with non-label operands, the restrictions, assumptions, and output requirements are as stated in problem 2.

Assignment 4, Problem 4 (9 marks out of 60; filename Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle beq and bne instructions with a label as the branch target operand.

Other than the inclusion of instructions containing label operands for the beq and bne instructions, the restrictions, assumptions, and output requirements are as stated in problem 3.

Assignment 4, Problem 5 (8 marks out of 60; filename: Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle the lis, mflo, and mfhi instructions.

Other than the inclusion of lis, mflo, and mfhi instructions, the restrictions, assumptions, and output requirements are as stated in problem 4.

Assignment 4, Problem 6 (8 marks out of 60; filename Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle the mult, multu, div, and divu instructions.

Other than the inclusion of mult, multu, div, and divu instructions, the restrictions, assumptions, and output requirements are as stated in problem 5.

Assignment 4, Problem 7 (8 marks out of 60; filename Asm.java or asm.ss or asm.c or asm.cc)

Modify your assembler to correctly handle the sw and lw instructions.

Your assembler should correctly translate any MIPS assembly language program, and write ERROR to standard error for any input that is not a valid MIPS assembly program.