[cc65] vic20 improvements

From: Daniel Gimpelevich <daniel1gimpelevich.san-francisco.ca.us>
Date: 2006-10-03 11:00:23
Before I get into what this message is about, Groepaz wanted me to add 
a second voice to his pleas to fix the cc65 preprocessor. Consider the 
following two lines:
#define FOO "foo.h"
#include FOO
The cc65 preprocessor does not accept that, although it should. It also 
does not allow preprocessor macros with a variable number of arguments, 
which it should. The patch below addresses neither of these issues.

There are also a couple of problems with the main makefile, corrected 
in the patch below.

Now, the good stuff: I saw in the archives of this list that 
suggestions to allow compiling for different memory configurations on 
the Commodore VIC-20 were at one point rejected, but later made 
feasible without actually being implemented. The VIC-20 allowed 127 
different possible physical configurations of memory (not making a 
distinction between additional RAM and ROM), most of which would have 
no point whatsoever. I made .cfg files for the configurations one would 
be most likely to encounter and included them in the patch below. This 
brings up an interesting topic: What happens when something compiled 
for one memory configuration is loaded on another? If loaded with 
relocation (the default), the first reference to an absolute address 
will send it into the wild blue yonder. If relocation is turned off, 
the load itself will likely fail, but loading without relocation 
(load"*",8,1) is useful only for special effects that cc65 isn't 
concerned with anyway. My patch adds comparison of the compile-time and 
run-time memory configurations, with a graceful way out if they don't 
match. As expected, there is a price to pay: 82 bytes. I don't think 
that's very much, considering the bloat that cc65 introduces, e.g. the 
compiled hello.c loads with a mere 737 bytes to spare on an unexpanded 
VIC-20. Keep up the good work!
-- 
"No gnu's is good gnu's."   --Gary Gnu, "The Great Space Coaster"

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Oct 3 11:00:35 2006

This archive was generated by hypermail 2.1.8 : 2006-10-03 11:00:38 CEST