Please help with this Assembly Language Problem Consider the

Please help with this Assembly Language Problem

Consider the code below: addi $t0, $zero, 5 addi $t1, $zero, 9 and $t2, $t0, $t1 What is the value stored in $t2 (in decimal without subscript) after the above code has been executed?

Solution

addi $t0, $zero, 5   //This means $t0 <- $zero + 5, i.e., 0 is added to 5, and the result is stored
                   //in $t0. After this instruction, $t0 holds 5.
addi $t1, $zero, 9   //This means $t1 <- $zero + 9, i.e., 0 is added to 9, and the result is stored
                   //in $t1. After this instruction, $t0 holds 5, and $t1 holds 9.
and $t2, $t0, $t1   //This means $t2 <- $t0 & $t1, i.e., 5(0000 0101) is bitwise AND with 9(0000 1001)
                   //and the result is stored in $t2. After this instruction, $t2 holds 0000 0001(1).
Therefore, the answer to your question:
What is the value stored in $t2 after the above code has been executed is 1.

Please help with this Assembly Language Problem Consider the code below: addi $t0, $zero, 5 addi $t1, $zero, 9 and $t2, $t0, $t1 What is the value stored in $t2

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site