Files
assembly/armv6/tutorial/conditionaljump.s
2019-02-19 22:02:06 +01:00

33 lines
445 B
ArmAsm

@ <intstruction> <destination> , <operand>, <operand>
.global _start
/*
CMP R1. R2
if R1 < R2 then N is enabled
if R1 > R2 then N is disabled
if R1 == R2 then Z is enabled
*/
_start:
MOV R1, #20
MOV R2, #10
CMP R1, R2
BEQ values_equal
BGT values_greater
values_less:
MOV R0, #2
B end
values_equal:
MOV R0, #1
B end
values_greater:
MOV R0, #3
end:
MOV R7, #1 @ exit to terminal
SWI 0 @ system reads R7 after interrupt