I am working this problem and I do not know how to solve it. Can you please help me approach it. Thank you Answer the
I am working this problem and I do not know how to solve it. Can you please help me approach it. Thank you
Answer the following questions with respect to the MIPS program shown below. Assume that the data segment starts at 0x10010000 and that the text segment starts at 0x00400000.
.data label: .word 24, 28 .byte 64, 32 .asciiz Example Program .text main: jal push jal pop li $v0, 10 syscall pop: lw $fp, 0($sp) lw $ra, 4($sp) addi $sp, $sp, 32 ret1: jr $ra push: addi $sp, $sp, -32 sw $fp, 0($sp) sw $ra, 4($sp) ret2: jr $ra
a) Write the values of the words stored at the following memory locations. Provide your answer in hexadecimal notation.
Word Address Value 0x10010008 0x0040000c 0x00400000
b) Consider the process of assembly of the above program, i) What would the symbol table in the output file contain? ii) What relocation information would be recorded if any?
c) What are the values of the following labels? ret1: push:
d) Assume that the procedure push and pop were assembled in a distinct file and statically linked with the main program. Further assume that the procedures (starting with the instruction labeled pop) are placed in the memory starting at location 0x00400040. Provide the encoding of the jal pop instruction.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started