比较数据段中X地址与Y地址上的值,较大者存入Z地址。 AREA D,DATA,READWRITE X DCD 3 Y DCD 9 Z DCD 0
AREA Example,CODE,READONLY
ENTRY
CODE32
START
LDR R1,X
LDR R2,Y
LDR R3,=Z
CMP R1,R2
BCC LAB1
SWP R2,R1,[R3]
B LAB2
LAB1
SWP R1,R2,[R3]
AREA D,DATA,READWRITE
X DCD 3
Y DCD 9
Z DCD 0
LAB2
END