In ARM assembly program calculate the absolute value of son


In ARM assembly program calculate the absolute value of son x variable a.

Solution

Ans .1. #Lets find absolute value of r1 ori $2, $zero, $1 #make a copy of r1 and store in r2 slt $3, $1, $zero #checks if r1 is negative beq $3, $zero, next #if r1 is positive, skip next inst sub $2, $zero, $1 #r2 = 0 - r1 next: #r2 has the absolute value of r1
 In ARM assembly program calculate the absolute value of son x variable a. Solution Ans .1. #Lets find absolute value of r1 ori $2, $zero, $1 #make a copy of r1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site