We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi i got a problem.I am giving the program aswell as how the program looks in the disassembly window.
Area copy, code , readonly ENTRY start LDR r1,=srcstr; pointer to the first string LDR r0,=dststr; pointer to the second string strcopy LDRB r2,[r1],#1 ; Loads a byte and update the address strb r2, [r0],#1; stores a byte and update the address cmp r2,#0 ; checks for zero terminator BNE strcopy stop SWI 0x11 ; terminate Area Strings, DATA, READWRITE srcstr DCB "ab",0 dststr DCB "second string-destination",0 END
0x00000000 00000000 ANDEQ R0,R0,R0 0x00000004 00000000 ANDEQ R0,R0,R0 0x00000008 00000000 ANDEQ R0,R0,R0 0x0000000C 00000000 ANDEQ R0,R0,R0 3: start LDR r1,=srcstr; pointer to the first string 0x00000010 E59F1014 LDR R1,[PC,#0x0014] 4: LDR r0,=dststr; pointer to the second string 5: strcopy 0x00000014 E59F0014 LDR R0,[PC,#0x0014] 6: LDRB r2,[r1],#1 ; Loads a byte and update the address 0x00000018 E4D12001 LDRB R2,[R1],#0x0001 7: strb r2, [r0],#1; stores a byte and update the address 0x0000001C E4C02001 STRB R2,[R0],#0x0001 8: cmp r2,#0 ; checks for zero terminator 0x00000020 E3520000 CMP R2,#0x00000000 9: BNE strcopy 10: 11: stop 0x00000024 1AFFFFFB BNE 0x00000018 12: SWI 0x11 ; terminate 0x00000028 EF000011 SWI 0x00000011