Oh boy, ummm no. The ASM I sent you. It goes in a script via callasm 0x08XXXXXX + 1. As soon as the rom starts, go set the break point on 08XXXXXX (notice how I didn't write the +1 here). Now, let the script, which contains the callasm, run. The rom should stop. Follow it (F3), and make sure it it is writing to the correct location. This location will not be stationary, but is rather DMA controlled. This is why we have to load the pointer at 0300500C. It will be different every time you run this.
There is no trace back function. (However, the address in r14 may give some clues as to the routine which called your asm). Also, following BLs with F7 often will leave you more confused than not, so stay in the routine. When you hit "pop {pc}", you are done. You have already scene the asm run.
Lastly, why would you need to go back if you set the breakpoint correctly? I can tell you exactly which function called the asm: callasm. A scripting command is simply an ASM routine. Scripts work like this:
1) Script loader - Reads the next byte in the script, multiplies by 4, adds to offset of the script table, goes to that routine.
2) That routine loads all of our parameters into registers (ie the offset of our asm).
3) That routine then does what it is supposed to do with those (in this case, it just jumps to the asm with a normal ldr r0, offset; bx r0). Then our ASM is run. Then it returns, returns again, and the process begins again.
So, there is absolutely no reason that a trace back function is necessary (or even useful) here, because all you will arrive at is the callasm script function routine thingy, and then back to the script loader.
There is no trace back function. (However, the address in r14 may give some clues as to the routine which called your asm). Also, following BLs with F7 often will leave you more confused than not, so stay in the routine. When you hit "pop {pc}", you are done. You have already scene the asm run.
Lastly, why would you need to go back if you set the breakpoint correctly? I can tell you exactly which function called the asm: callasm. A scripting command is simply an ASM routine. Scripts work like this:
1) Script loader - Reads the next byte in the script, multiplies by 4, adds to offset of the script table, goes to that routine.
2) That routine loads all of our parameters into registers (ie the offset of our asm).
3) That routine then does what it is supposed to do with those (in this case, it just jumps to the asm with a normal ldr r0, offset; bx r0). Then our ASM is run. Then it returns, returns again, and the process begins again.
So, there is absolutely no reason that a trace back function is necessary (or even useful) here, because all you will arrive at is the callasm script function routine thingy, and then back to the script loader.