Use the following program for this question. Assume the .data section starts at
ID: 3882703 • Letter: U
Question
Use the following program for this question. Assume the .data section starts at 0 times 10010000 and the .text starts at 0 times 00400010, 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: lui $t0, 0 times 1001 top: lw $t1, 0 ($t0) beg $s0, $0, end jal func add $s0, $s0, $t0 addi $s0, $0, -1 j top bne $S0, $0, top end: func: sll $v0, $t1, 4 jr $ra a. There are five labels in the code. What is the value of each label? b. What is the addressing mode for each instruction? There are 10 unique instructions. c. Encode the program and give the machine code in hex. Be careful with the branch and jump instructions.Explanation / Answer
a. The five lables of the code are following
1. Data 7
2. Global Main
3. Main
4. Top
5. Function
b. The three basic modes of addressing are
1. Register addressing
2. Immediate addressing
3. Memory addressing
1. PDP-8
2. PDP-10
3. PDP 11
4. VAX Instructions
5. Pentium Instruction Format
6. ARM Instruction Formats
7. Thumb Instruction Set