Question: What does the following code do? main: lw $t0, a # memory location a holds an integer ble $t0, $zero, exit sub $t0, $zero, $to


What does the following code do? main: lw $t0, a # memory location a holds an integer ble $t0, $zero, exit sub $t0, $zero, $to SW $to, a exit: negates any integer replaces a negative number with its positive replaces a positive number with its negative replaces an integer with its absolute value The following code stores the greater of (a, b) in location c. main: lw $to, a lw $t1, b bgt $t1, $t0, else SW $t1, c j exit else: SW $t0, C exit: True False What does the following code do? .data s1: .asciiz "hi" .align 2 s2: .space 4 .text main: la $t1, s1 la $t2, s2 * loop: lbu $t5, ($t1) sb $t5, ($t2) beq $t5, $zero, exit addi $t1, $t1, 1 addi $t2, $t2, 1 j loop exit: li $v0, 10 syscall the code copies the contents of s1 to s2 the code coples the contents of s2 to 1 none of these the code zeros out the contents of s1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
