Name
Conditional Flags
Equal
Z
Not Equal
z
Carry Set/ unsigned
High or Same
C
Carry Clear / unsigned Lower
c
Minus / negative
N
Plus / positive or zero
n
Overflow
V
No overflow
v
unsigned higher
zC
unsigned lower or same
Z or c
signed greater that or equal
NV or nv
signed less than
Nv or nV
signed greater than
NzV or nzv
signed less than or equal
Z or Nv or nV
always (unconditional)
ignored
Ex 5.1: Write a program to have a leading 1 in a binary number in the most significant bit
position.
AREA reset, CODE, READONLY
EXPORT Reset_Handler
Reset_Handler
main
MOV R4, # 0
CMP R3, # 0
loop
finish
BLE finish
MOVS R3, R3, LSL # 1
ADD R4, R4, # 1
BPL loop
; if yes, done
; shift one bit
; increment shift counter
B finish
END