COUNTING NEGATIVE NUMBERS
AREA data1,data,readonlyDCD 2,3,-4,-5
num equ 0x80000000
AREA data2,data
SPACE 1
AREA prog,code,readonly
ENTRY
ldr r4,=num
mov r3,#4
ldr r0,=data1
up ldr r1,[r0],#4
tst r1,r4
beq skp
add r5,#1
skp subs r3,#1
bne up
ldr r0,=data2
str r5,[r0]
s b s
END
Comments
Post a Comment