CC2302 COAL Lab # 02
CC2302 COAL Lab # 02
CC2302 COAL Lab # 02
# Load the immediate value -10 (use negative sign) into register $t2
li $t2, -10
2. Why the message is not in correct order? Such as “Please enter an integer”
3. Run one step at a time and observe the values of following registers.
4. The instruction la $a0, prompt is translated into two instruction. Which instruction and
why?
7. Why the source code is being started from Line # 5 and ending at Line # 26 in the below
given figure? However, the MIPS code written in editor started from Line # 1 and ends at
Line # 29?
8. What is machine code (hex) of syscall?
2. Run one step at a time and observe the values of following registers.
3. Enter a string and observe where it is stored in data memory and why?
Address Value(+0) Value(+4) Value(+8) Value(+c) Value(+10) Value(+14) Value(+18) Value(+1c)
0x100100
0
0x100102
0
0x100104
0
0x100106
0
4. When the required string is entered, in which registers its data address is stored?
Task # 3:
1. Prompt User to Enter 1st (1-digit) number
2. Prompt User to Enter 2nd (1-digit) number
3. Add two numbers
4. Display result in the following format:
Task # 4:
1. Prompt user to enter a lower case letter character
2. Convert it into Upper Case character
3. Output the result in the following format: