Writing ARM and Thumb Assembly Language

2.5.2Execution conditions

The relation of condition code suffixes to the N, Z, C and V flags is shown in Table 2-1.

 

 

Table 2-1 Condition code suffixes

 

 

 

Suffix

Flags

Meaning

 

 

 

EQ

Z set

Equal

 

 

 

NE

Z clear

Not equal

 

 

 

CS/HS

C set

Higher or same (unsigned >= )

 

 

 

CC/LO

C clear

Lower (unsigned < )

 

 

 

MI

N set

Negative

 

 

 

PL

N clear

Positive or zero

 

 

 

VS

V set

Overflow

 

 

 

VC

V clear

No overflow

 

 

 

HI

C set and Z clear

Higher (unsigned > )

 

 

 

LS

C clear or Z set

Lower or same (unsigned <= )

 

 

 

GE

N and V the same

Signed >=

 

 

 

LT

N and V differ

Signed <

 

 

 

GT

Z clear, N and V the same

Signed >

 

 

 

LE

Z set, N and V differ

Signed <=

 

 

 

AL

Any

Always. This suffix is normally omitted.

 

 

 

Examples

ADD

r0, r1, r2

; r0

= r1

+ r2,

don't update

flags

ADDS

r0, r1, r2

; r0

=

r1

+

r2,

and update flags

ADDCSS

r0,

r1, r2

;

If

C

flag

set

then

r0

= r1

+ r2, and update flags

CMP

r0,

r1

;

update flags based

on

r0-r1.

ARM DUI 0068B

Copyright © 2000, 2001 ARM Limited. All rights reserved.

2-21

Page 33
Image 33
ARM VERSION 1.2 manual Execution conditions, Examples