Hi all. I’m working on my Bad Apple! video decoder and have this version just about finished up.
One of the last things I wanted was a self contained ROM that boots right up to the demo.
The problem is that I have a little bit of self modifying code so I want to move some to RAM and I don't quite know what the correct way is to deal with this.
I know how to move data from ROM to RAM, but how do I deal with it from the source side?
IE, I can do a:
Code:
.org $500
.. source code ..
assemble, then on my ROM file do something like
Code:
.org $5000
.. source code ..
.org $6000
include file.bin
but I was wondering if there was a way to keep everything in the same source file?
Is there a 'Assemble To' command that I can't seem to figure out?
Maybe something like:
Code:
.org $6000
.. source code..
.RelocateLoop ;routine to move code
LDA RelocateCode,x
STA $500,x
inx
bne .RelocateLoop
RelocateCode: ; location in output is after above code
.assembleto $500 ; but the code uses $500 as base address
.Top ; location $500
.. source code ..
jmp .Top ;IE jmp $500
.Bottom
endassembleto
I can’t quite seem to find what I’m looking for from the source code management side.
Thanks!