|
AREA StrCopy, CODE, READONLY<br /> ENTRY ; mark the first instruction to call<br /><br />start<br /> LDR r1, =srcstr ; pointer to first string<br /> LDR r0, =dststr ; pointer to second string<br /><br /> BL strcopy ; call subroutine to do copy<br /><br />stop<br /> MOV r0, #&18 ; angel_SWIreason_ReportException<br /> LDR r1, =0x20026 ; ADP_Stopped_ApplicationExit<br /> SWI 0x123456 ; ARM semihosting SWI<br /><br /><br />strcopy <br /> LDRB r2, [r1],#1 ; load byte and update address<br /> STRB r2, [r0],#1 ; store byte and update address;<br /> CMP r2, #0 ; check for zero terminator<br /> BNE strcopy ; keep going if not<br /> MOV pc,lr ; Return<br /><br /><br /> AREA Strings, DATA, READWRITE<br />srcstr DCB "First string - source",0<br />dststr DCB "Second string - destination",0<br /><br /> END<br />以上是一条字符串拷贝程序,<br />程序执行到BL strcopy后,没有跳转到strcopy处,而是继续执行下一条语句(stop),请问为什么? |
|