CPS104 Exam 1 Oct 12, 2000 1. Write a sequence of 4 SPIM conditional branch instructions which tests the ASCII code C in register $t0, and branches to NL if C represents a non-letter, to LC if C represents a lower case letter, and "falls through" if C represents an upper-case letter. Your program can use SPIM pseudo-instructions, like "beq $t0, 33, NL", which branches to NL if R[$t0]==33. For convenience, 'a'==97, 'z'==122, 'A'==65, and 'Z'==90. 2. Write code equivalent to the SPIM instruction "lbu $t0, CHAR($t1)", where "CHAR" is a label for location 0x18003: a. in MYMIPS assembly language b. in basic MIPS (no pseudo-instructions) assembly language 3. Convert each of the following numbers to single precision floating point representation, showing the steps of your work, and ending with hexadecimal representations for each of them: a. 0.75 b. -2.25 4. Write an RMI program which, given integers in variables A and B, sets variable C to 1 if bits 29 of both A and B are 1, and sets C to 0 otherwise. Do not use any constants larger than 100 in magnitude in this program. Of course, it should run quickly, as well (less than 30 basic RMI instructions). 5. Write a SPIM program to solve the same problem as in question 4, allocating space for variables A, B and C in memory properly. Your program should be a complete SPIM program, including the proper directives. The program should include a "main" procedure which returns properly. The program should execute as quickly as possible.