Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions