Assume that $s1 = 0x87654321. Determine the content of registers $s2 to $s4 after executing the following instructions:
sll $s2,$s1, 16 # $s2 =
srl $s3,$s1, 8 # $s3 =
sra $s4,$s1, 12 # $s4 =
Write mips assembly language program to execute these instructions and verify the content of registers $s2 to $s4.
COMMENT COMPLETE CODE PLEASE
Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate
the question. Thank You So Much.
li $s1,0x87654321
sll $s2,$s1, 16 # $s2 = it will be left shift of s1, Hence it will
be 0x43210000
srl $s3,$s1, 8 # $s3 = it will be right shift of s1, Hence it will
be 0x00876543
sra $s4,$s1, 12 # $s4 = it will be arthmatic right shift of s1,
Hence it will be 0xfff87654
Get Answers For Free
Most questions answered within 1 hours.