Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Use the following program for this question .data num: .word 9 .half 7, 3 glo

ID: 3728466 • Letter: 1

Question

1. Use the following program for this question .data num: .word 9 .half 7, 3 globl .text main mairn lui t0, 0x1001 top: lw $t1, -4 ($t0) beq $s0, $s2, end jal func add $s0, $sl, $t0 andi $S0, $0, 0xFFFF top bne $s0, $0, top end: func: sll $v0, $tl, 4 $ra a. There are 5 labels in this code. If the .data section starts at 0x10010000 and the .text starts at 0x00400400, what is the value of each label? Include all labels from the program. 2.5 points b. What is the addressing mode for each instruction? There are 10 unique instructions. 2.5 points c. "Assemble" the program by converting it to the machine code (hex). 15 points

Explanation / Answer

A)

num : 0x 10010000

main : 0x00400010

top : 0x 00400014

end : 0x00400030

func: 0x00400030

B)

LUI : IMMEDIATE

LW : INDEXED ADDRESSING MODE

BEG: DIRECT

JAL : DIRECT

ADD : DIRECT

ADDI : IMMEDIATE

J top : ABSOLUTE JUMP

BNE : DIRECT

SII : IMMEDIATE

JR : REGISTER INDIRECT

As per the policy of chegg i am only providing the solution for first 2 options so kindly post the 3rd option in another query.

Let me know for any further help regarding this question.