NOTE: PLEASE SHOW ALL WORK Use the following program for this question. Assume t
ID: 3784113 • Letter: N
Question
NOTE: PLEASE SHOW ALL WORK
Use the following program for this question. Assume the .data section starts at 0x10010000 and the .text starts at 0x00400010. Notice for this problem the starting PC will NOT be the default value so if you just type the code into the assemble, your answers may not be correct. .data num: .word 7 .globl main .text main .text main: lui $t0, 0x1001 top: lw $t1, 0($t0) beq $s0, $0, end jal func add $s0, $s0, $t0 addi $s0, $s0, -1 j top bne $s0, $0, top end: func: s11 $v0, $t1, 4 jr $ra There are five labels in the code. What is the value of each label? What is the addressing mode for each instruction? There are 10 unique instructions. Encode the program and give the machine code in hex. Be careful with the branch and jump instructions.Explanation / Answer
a)
num: 0x10010000
main: 0x00400010
top: 0x00400014
end: 0x00400030
func: 0x00400030
b)
lui-immediate
lw-based or indexed addressing
beq-direct
jal-direct
add-direct
addi-immediate
has- immediate
bne-direct
sll-immediate
jr-register
c)
DAAD7BAEA001001100BE00EDAFCADD000ADD001BE00EDFC511014A
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.