Question: Please answer part A, B and C based on the Anna code. 2. Assume that ANNA files can now be assembled into object files and
Please answer part A, B and C based on the Anna code.


2. Assume that ANNA files can now be assembled into object files and linked. Consider the following ANNA program and answer the following questions. For your convenience addresses precede each instruction. They are not part of the instruction. (10+ 10+10) # Code section 0 start: lli rl &count 1 lui rl &count 3 lli r3 &total 4 lui r3 &total 5 swr2r30 6 lli r4 0 7 lli r58 8 begin: sub r7 r4 rs 9 bgz r7 &end 10 lli r7 &compute 11 lui r7 &compute 12 jalr r7 r6 13 swr3 rl0 14 li 2 &tally 15 lui r2 &tally 16 w r3 r20 17 addi r3 r31 18 sw r3 r20 19 addi r4r4 1 20 bez r0 &begin 21 end: lli r7 &output 22 lui r7 &output 23 jalr r7 r6 24 .halt 25 output: out r3 26 jalr r6 r0 # Data section 27 count .fill 10 28 total: fill &score NOTE: Refer to slides 1 to 114 of the "Lecture4.pdf" on Canvas. To get you started,I am providing sample answers to each of the following parts, please complete the solutions by filling in the remaining information. A. Assuming that all labels are visible, what would be the contents of the entry point table? Hint: (start, 0) B. What would be the contents of the external reference table? Hint:tally C. What would be the contents of the relocation dictionary Hint: This will be a list of instruction addresses, or line numbers in our case, such as 3. Compilers and Assemblers translate each source file individually to generate object code files. Hence the object files need to be linked together before they can be executed. Theoretically, however, it is possible to skip the linking step and directly have compilers generate the final executable file. What would be the down side of taking the latter approach? (10 points) What is contained in an activation record? (10 points) 5. How are two dimensional arrays represented in memory using row-major ordering? (10 points) 2. Assume that ANNA files can now be assembled into object files and linked. Consider the following ANNA program and answer the following questions. For your convenience addresses precede each instruction. They are not part of the instruction. (10+ 10+10) # Code section 0 start: lli rl &count 1 lui rl &count 3 lli r3 &total 4 lui r3 &total 5 swr2r30 6 lli r4 0 7 lli r58 8 begin: sub r7 r4 rs 9 bgz r7 &end 10 lli r7 &compute 11 lui r7 &compute 12 jalr r7 r6 13 swr3 rl0 14 li 2 &tally 15 lui r2 &tally 16 w r3 r20 17 addi r3 r31 18 sw r3 r20 19 addi r4r4 1 20 bez r0 &begin 21 end: lli r7 &output 22 lui r7 &output 23 jalr r7 r6 24 .halt 25 output: out r3 26 jalr r6 r0 # Data section 27 count .fill 10 28 total: fill &score NOTE: Refer to slides 1 to 114 of the "Lecture4.pdf" on Canvas. To get you started,I am providing sample answers to each of the following parts, please complete the solutions by filling in the remaining information. A. Assuming that all labels are visible, what would be the contents of the entry point table? Hint: (start, 0) B. What would be the contents of the external reference table? Hint:tally C. What would be the contents of the relocation dictionary Hint: This will be a list of instruction addresses, or line numbers in our case, such as 3. Compilers and Assemblers translate each source file individually to generate object code files. Hence the object files need to be linked together before they can be executed. Theoretically, however, it is possible to skip the linking step and directly have compilers generate the final executable file. What would be the down side of taking the latter approach? (10 points) What is contained in an activation record? (10 points) 5. How are two dimensional arrays represented in memory using row-major ordering? (10 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
