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
I would like to know how i could make my program execution to start at 0x00000010. After you load the program into the simulator, type $=0x10 in the command window. This sets the program counter address. Jon
Fine it works with the command prompt... Well , Is there any file inside keil that i could change so that the program execution starts automatically at the location 0x00000010 when i run the program. If so which file should i look into, to change the PC location? Thanks for ur help Jon.
Well , Is there any file inside keil that i could change so that the program execution starts automatically at the location 0x00000010 when i run the program. You can create a script file with whatever commands you want to run when the debugger starts (see the Debug tab on the project options dialog). You can add
$=0x10 g