Constructing a relocation page table

From: Marko Mäkelä (
Date: 2003-04-28 20:51:49

I'm working on the next version of cbmlink.  I'd like to provide the cbmlink
server programs with a BASIC header that transfers the machine code in place.
To make things more flexible, I'd document a POKE that allows the user to
specify an alternative loading address for the machine code, with 256 bytes
of granularity.  For example, instead of loading the code to $cc00 on the
C64, the user could POKE X,192 and load it to 49152.

Now, the problem is: how can I produce a list of all locations that need
to be patched?  If I remember correctly, the CS-DOS code (a C128 shell
extension made by Chris Smeets) does this by assembling the code at two
different offsets and comparing the resulting binaries.  Is there a more
"intelligent" way?  I'd like to use André Fachat's xa, but porting the
code to the assembler of the cc65 compiler suite is not out of the question.


PS: Nicolas Welte asked a while back if the code is ROMable.  It seems to be.
I've spotted only two occurrences of self-modifying code, neither of which is
necessary in a ROM-based installation.  First, the program writes the original
value of the IRQ vector for the deinstallation routine.  Second, the C2N232
routine saves the state of the I/O port connected to CASS WRITE.  That can be
rewritten easily.

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.