For this assignment assume you are given the following assem
Solution
Solution:
Q1 a)
L R1, a Value of a loaded into R1
L R2,b value of b loaded into R2
ADD R3, R1,R2 values inside R1 and R2 is added and result stored into R3
L R1,c Value of c losded into R1
L R2, d Value of d loaded into R2
DIV R4, R1, R2 values inside R1 and R2 is divided and result stored into R4
MULT R3,R3,R4 values inside R3 and R4 is divided and result stored into R3
ST f, R3 value of R3 stored into f
Q1 b)
PUSH a Value of a push into stack
PUSH b Value of b push into stack
ADD a and b are added and result is push into stack
PUSH d Value of d push into stack
PUSH c Value of c push into stack
DIV c and d are divided and result is push into stack
POP f final result stored into f
Q2.
L R1, a
L R2, b
COMP R1, R2
BGT R2, ELSE
ST R1, R2
j EXIT
ELSE: ST R2, R1
EXIT:
