; This program calculates the sum of signed numbers AREA PROG5_1,CODE,READONLY ENTRY LDR R0,=SIGN_DAT MOV R3,#9 MOV R2,#0 LOOP LDRSB R1, [R0] ;Load into R1 and sign extend it. ADD R2,R2,R1 ;R2 = R2 + R1 ADD R0,R0,#1 ;point to next SUBS R3,R3,#1 ;decrement counter BNE LOOP LDR R0,=SUM STR R2,[R0] ;Store R2 in location SUM HERE B HERE SIGN_DAT DCB +13,-10,+19,+14,-18,-9,+12,-19,+16 AREA VARIABLES,DATA,READWRITE SUM DCD 0 END