iTem1 -- SubToResult.s
有两个数,用大数减去小数,直到结果为0为止;
Code is as follow:
AREA item1,CODE,READONLY
ENTRY
CODE32
START
MOV R0,#80; Set R0=80
MOV R1,#33; Set R1=33
LOOP
CMP R0,R1; Compare R0,R1
SUBLT R1,R1,R0; If R1>R0,then R1=R1-R0
SUBGT R0,R0,R1; If R0>R1,then R0=R0-R1
BNE LOOP; If R0=R1,then jump out loop
END