ARM Assembly Code to find the length of Carriage return terminated string
This code is tested in Keil uVision 4.
Basically The Carriage Return (CR) character (0x0D, r) moves the cursor to the beginning of the line without advancing to the next line. This character is used as a new line character in Commodore and Early Macintosh operating systems (OS-9 and earlier).
ARM Code :
area string,code<br />entry<br />LDR R0,=data<br />MOV R1,#00<br />loop LDRB R2,[R0],#1<br /> CMP R2,0x0D<br /> BEQ stop<br /> ADD R1,#1<br /> B loop<br />stop b stop<br />data dcb "codesexplorerr"<br />end<br /></code><br />
Output Pic :
To Download the Code click on the link below: