Be sure you have read, or at least skimmed, the assigned readings from Chapter 2 up through 2.7.
Please include with each part of the assignment the Honor Code pledge or just the word ``pledged'', plus one or more of the following about collaboration and help (as many as apply).1Text in italics is explanatory or something for you to fill in. For written assignments, it should go right after your name and the assignment number; for programming assignments, it should go in comments at the start of your program(s).
Answer the following questions. You may write out your answers by hand or using a word processor or other program, but please submit hard copy, either in class or in one of my mailboxes (outside my office or in the ASO).
Tips:
sub $t0, $s1, $s2
addi $s1, $s1, -1
(We didn't do an example of addi in class, but like lw and sw it's an I-format instruction.)
$t1 0xFFFFFFFF $t2 0x12345678
For each of the sequences of MIPS instructions, what does $t0 contain, in hexadecimal, after it is executed?
sll $t0, $t1, 16 and $t0, $t0, $t2
srl $t0, $t1, 16 or $t0, $t0, $t2
sra $t0, $t1, 16 and $t0, $t0, $t2
ori $t0, $t2, 0xFF(Assume that the assembler is smart enough to convert 0xFF to an appropriate 16-bit constant.)
.text addi $t1, $0, 0 la $s0, MemArray addi $s2, $0, 0 LOOP: lw $t2, 0($s0) add $s2, $s2, $t2 addi $s0, $s0, 4 addi $t1, $t1, 1 slti $t2, $t1, 100 bne $t2, $0, LOOP .data MemArray: .space 400 # reserve space for 400 bytes, i.e., 100 words