Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. (30 points) Some architectures support the \'memory indirect\' addressing mod

ID: 3748684 • Letter: 2

Question

2. (30 points) Some architectures support the 'memory indirect' addressing mode. Below is an example where register R5 contains a pointer to a pointer and two memory accesses are required. Assme that our ISa does nat upor nendret addrestng, mplment the ADD R3, @(R5) functionality of the previous statement using other addressing modes that were covered in the class. Note that you can use multiple instructions. Assume that the pointer to pointer is currently in R5, R3 holds the value to be added, and the result will be stored in R3.

Explanation / Answer

Answer is as follows :

We know that pointer is currently in R5 and value i.e. to be added hold by R3.

So according to given scenarion, the process is follows :

MOV R1, R5 // Move the contents of pointer R5 to R1 with Register Deffered or Indirect Mode.

ADD R3,R1 // Now add the contents of R1 with R3 and store back to R3 by Register Addressing mode.

it would provide same result in ISA as ADD R3, @(R5).

if there is any query please ask in comments....

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote