Answered step by step
Verified Expert Solution
Question
1 Approved Answer
b ) ( 0 . 5 Point ) Please explain the functionality of the program ( i . e . , what it does )
b Point Please explain the functionality of the program ie what it does and give the updated data in the memory after the program execution in Table
Solution:
It's like a sort functionlike insertion sort sorting from small to large.
Table : Updated Memory Content After Program Execution
tableAddressMomory Contentdotsdots,dots,dots,cdots,dots,dots,dots,dotstimes times times btimes etimes Etimes btimes etimes times times times times times times times times times times dotsdots,dots,dots,cdots,dots,dots,dots,...
c Point Are there any problem with this program? Hint: related to issues of register usage convention
Solution:
Yes. We may affect the register values outside the function.
So we need to use local registers and stack space to ensure our uses do not affect the register values outside the function. Points Table gives the RISCV binary code and data both in hexadecimal representation for a program. Suppose before program execution.
Table : Memory Content Before Program Execution
tableAddressMomory,Content,,,cdotscdots,cdots,cdots,cdots,...,cdots,cdots,xtimes Eetimes times xBeExxxxxxdxxinfeBexexinexxdexinfexxlarretimes :times xinetimes Bdots,...cdotscdots,cdots,cdots,...,...,cdots,cdots,cdotstimes times etimes times etimes btimes Extimes btimes times times times times times times xtimes times cdotscdots,cdots,cdots,cdots,cdots,cdots,cdots,cdots
a Point Please translate the RISCV binary code back into RISCV assembly code in Table The semantics of the first instruction AUIPC is: and here Imm
Table : Assembly Code of the Program
tableLabelInstructionL: AUIPC times times fcL:ADDI xxL:ADDI X XL:JAL x LL:JALR xxL:ADDI x XL:SLLI xxL:ADD xxxL:BGE xx LL:LWxxL:ADDI xxL:BLT xx LL:LW xxL:BGE xx LL:SW xxL:ADDI xxL:BEQtimes xLL:SW times times L:ADDI xxL:BEQtimes xLL:JALR xx
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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