LENGTH OF NULL TERMINATED STRING
;Program to find the length of a null terminated stringAREA data1,data,readonly
strr DCB "Advanced",'0'
AREA data2,data
SPACE 1
AREA progq,code,readonly
ENTRY
ldr r0,=strr
up ldrb r2,[r0],#1
cmp r2,#'0'
beq done
add r1,r1,#1
b up
done ldr r0,=data2
str r1,[r0]
s b s
END
Comments
Post a Comment