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
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