Re: [cc65] Question about writing assembler app for both C128 and C64

From: Payton Byrd <plbyrd1gmail.com>
Date: 2010-05-14 23:07:41
On Fri, May 14, 2010 at 3:51 PM, Ullrich von Bassewitz <uz@musoftware.de>wrote:

>
> On Thu, May 13, 2010 at 10:15:05AM -0500, Payton Byrd wrote:
> > 1) How to determine the current system.
> > 2) How to configure the code so that it will load and run from the same
> > executable on both platforms
>
> What do you mean with that? Are you trying to distinguish between the C64
> and
> the C128, for example? If so, this will cause some problems, since the code
> (if piggy-backed on a basic program, as with cc65 generated executables)
> will
> run at different addresses, so it must be relocatable. Your best bet may
> actually be to write it in BASIC, since it will then run on most if not all
> CBM platforms, provided that you only use BASIC commands from earlier
> versions.
>
>
I actually managed to write an assembly loader that worked in both 128 and
64 modes... but the problem was that I didn't relocate the code to somewhere
safe, such as the tape buffer.  So when I loaded CBM-Command as soon as it
overwrote my loader the whole thing would crash.  I eventually just wrote
the loader in BASIC, but I do want to go back and finish the assembler
version, but just adding code to relocate the loader portion to the tape
buffer before executing it.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri May 14 23:08:09 2010

This archive was generated by hypermail 2.1.8 : 2010-05-14 23:08:11 CEST