Question: Read the assembly code below and explain what this procedure is trying to do newproc: blt $a1, $zero, loop2 loop1: beq $a1, $zero, procend sll
Read the assembly code below and explain what this procedure is trying to do
newproc: blt $a1, $zero, loop2 loop1: beq $a1, $zero, procend sll $a0, $a0, 1 addi $a1, $a1, -1 j loop1 loop2: beq $a1, $zero, procend srl $a0, $a0, 1 addi $a1, $a1, 1 j loop2 procend: add $v0, $a0, $zero jr $ra
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
