Create a new ASSEMBLY project using Keil Software Make sure

Create a new ASSEMBLY project using Keil Software Make sure you use the M3 option Make sure you name the folder \"COSC2440_Lab04_YourFirstName_YourLastName\" Assign the following values: R1 = 3 R2 = 15 If R1 less than or equal to R2, then evaluate the following formula using: R3 = sigma (50 - n - n + R1 + R2) If R1 is greater than R2, then assign the following: R3 = |R1| + |R2|, where | | means absolute value Make sure you test both cases by changing the values for R1 and R2 accordingly.

Solution

var1 DCD 0x03
var2 DCD 0x0f

LDR R0,=var1
LDR R1,[R0]
LDR R0,=var2   
LDR R2,[R0]   
LDR n,R1

CMP R1,R2
IF R1<=R2
L1 :
ADD R1,R2
MOV AX,R1
SUB OX32,N,N
MOV BX,N
ADD AX,BX
MOV R3,AX
INC n
  
ELSE
abs $R1,$R1
abs $R2,$R2
ADD R1,R2
MOV R3,R1

ENDIF

 Create a new ASSEMBLY project using Keil Software Make sure you use the M3 option Make sure you name the folder \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site