NOP – no operation, ADD – addition, ADDI – addition immediate ,
ANDI – bitwise immediate and, SRL – shift right logical, SLL – shift left logical,
BEQ – branch on equal, BNE – branch on not equal
Your implementation should manipulate the pc register value and emulate addresses in the text
memory area (0x00400000 – 0x1001000, start from address 0x00400000) and should provide a way
to terminate the execution of a program (e.g. nop instruction).
• Marks will be awarded only for the exec_bytecode function implementation and any new
functions that you will define/implement to improve code readability.
• You should use the update template, which can be found at
zip to implement your solution, which contains a correct implementation of the
Code elegance, clarity, organization 30%
A+ Registers are handled correctly in all cases, there is a method to terminate the
program, the emulator executes correctly complex MIPS programs.
A The program can parse and execute branch instructions.
B I-type instructions are correctly parse and executed (addi, andi).
C R-type instructions are correctly parsed and executed (add, srl, sll).
D Program is read from the int array, a loop is implemented to execute the program
(program counter is used), code is executed based on instruction opcode and func
(*) This is an example of a marking scenario and marks are awarded proportionally for each
functionality. If you code only implements the addi and andi insutrctions and a simple loop, then you
will get a C.
A Clear structure (and helpful comments) about variable use. Well commented
throughout. Spaced and organised for clarity. Appropriate use of function to organize
B Good use of comments. Reasonable organisation, can follow program reasonably well.
Variable use is sensible.
C Sparse or sometimes unhelpful comments. Some consistency in use of variables.
D No comments. Difficult to read code