Consider the following MIPS assembly language snippet. The numbers to the left of each instruction indicate the instruction address.
0x00400028 add $a0, $a1, $0
0x0040002C jal f2
0x00400030 f1: jr $ra
0x00400034 f2: sw $s0, 0($s2)
0x00400038 bne $a0, $s0, else
0x0040003C j f2
0x00400040 else: addi $a0, $a0, -1
0x00400044 j f2
a. Translate the instruction sequence into machine code. Write the machine code instructions in hexadecimal
0x00400028: 0x00851820
0x0040002C: 0x0C000000
0x00400030: 0x03E00008
0x00400034: 0xAC100000
0x00400038: 0x10800002
0x0040003C: 0x08000003
0x00400040: 0x2084FFFF
0x00400044: 0x08000003
b. List the addressing mode used at each line of code.
0x00400028: Register-Register
0x0040002C: Jump and Link
0x00400030: Jump Register
0x00400034: Store Word
0x00400038: Branch Not Equal
0x0040003C: Jump
0x00400040: Add Immediate
0x00400044: Jump