go to previous page   go to home page   go to next page

Answer:

NO. The first instruction keeps the upper half of $10 the same and ORs in some bits in the lower half.

The second instruction replaces all 32 bits of $10 with the zero-extended immediate operand.

ori  $10,$10,0x00C4

ori  $10,$0, 0x00C4

Assembly Arrays

Part of Memory

An array of int is implemented as a sequence of words in successive word-aligned memory locations. For example, the diagram shows a possible implementation of:

int data[] = {0, 1, 2, 3, 4, 5};

The above is expressed using the language C, but you don't have to know any C to understand this page. The declaration creates an array of six elements and initializes them to the integers zero through five.

QUESTION 12:

What is the most sensible address to have in the base register for processing this array?