In: Computer Science
a. Write machine code for the following assembly code. Assume that the segment is placed starting at location 80000. Use decimal numbers to represent each instruction.
loop: beq
$s3, $s1, endwhile
add $t0, $s3, $s4
lw
$t1, 0($t0)
add $s0, $s0, $t1
addi
$s3, $s3, 4
j loop
endwhile:
b. Write assembly code for the following machine code. Assume that the segment is placed starting at location 80000. Create labels for jump and branch instructions. Indicate the actual memory addresses represented by such labels.
0010 1010 0000 1000 0000 0000 0000 1010
0001 0001 0000 0000 0000 0000 0000 0010
0000 0010 0001 0001 1000 0000 0010 0000
0000 1000 0000 0000 0100 1110 0010 0101
0000 0010 0001 0010 1000 0000 0010 0000