;Using Full Ascending Load and Store for stack AREA PROG6_2, CODE, READONLY ENTRY LDR R13,=Stack_Top ;load SP LDR R0,=0x125 ;R0 = 0x125 LDR R1,=0x144 ;R1 = 0x144 MOV R2,#0x56 ;R2 = 0x56 BL MY_SUB ;call a subroutine ADD R3,R0,R1 ;R3 = R0 + R1 = 0x125 + 0x144 = 0x269 ADD R3,R3,R2 ;R3 = R3 + R2 = 0x269 + 0x56 = 0x2BF HERE B HERE ;stay here ;--------------------------- MY_SUB ;--------save R0, R1, and R2 on stack before they are used by a loop STMFA R13,{R0-R2} ;save R0,R1,R2 on stack using Full Ascending ;--------R0,R1, and R2 are changed MOV R0,#0 ;R0=0 MOV R1,#0 ;R1=0 MOV R2,#0 ;R2=0 ;---------restore the original registers contents from stack LDMFA R13,{R0-R2} ;restore R0,R1,and R2 from stack using F. Ascending BX LR ;return to caller END