Answer:
GLOBAL minRoutine
AREA MYCODE, CODE, READONLY
ENTRY
minRoutine
MOV r0, #0xA
MOV r1, #0x3
MOV r3, #0x8
CMP r0,r1
BLT less1Routine
CMP r1,r0
BLT less2Routine
MOV r4,r3
less1Routine
CMP r0,r3
BLT cond1
less2Routine
CMP r1,r3
BLT cond2
cond1
MOV r4,r0
cond2
MOV r4,r1
END
Step-by-step explanation:
- Inside the minRoutine, move the essential values to the r0, r1 and r3 registers.
- Check if a is greater than b by comparing value in r0 with r1.
- Jump to less1Routine, if value of r0 is less than value of r1. Otherwise go to next instruction .
- Check if b is greater than a by comparing value in r1 with r0.
- Jump to less2Routine, if value of r1 is less than value of r0. Otherwise go to next instruction .
- Finally move result of r1 into r4 register.