Question: MIPS ASSEMBLY 1. Addressing Modes (1) Absolute (2) Register indirect (3) Based (base + displacement) (4) Scale indexed (base + index constant) (5) Memory indirect

MIPS ASSEMBLY

1. Addressing Modes (1) Absolute (2) Register indirect (3) Based (base + displacement) (4) Scale indexed (base + index constant) (5) Memory indirect (6) Auto increment/decrement (by 1 byte).

Consider the following high-level programs:

uint8_t a[150]; // a allocated in memory

for (i = 0; i < 150; i++) {

a[i] = 5;

}

int a[150]; // a is allocated in memory

for (i = 0; i < 150; i++) {

a[i] = 5;

}

int *p; // *p is allocated in memory

*p = 150;

int **p; // *p and **p are allocated in memory

**p = 150;

Assume that in the first two programs, a register contains the address of the start of the array, and in the last two programs, a register contains the value of p. For each of the above three programs, which of the addressing modes, do you think, would lead to the minimum number of instructions? (Note that no addressing mode fits perfectly. You might require other instructions for address computation.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!