Re: [cc65] Autostart ROM VIC-20 or C64 template project?

From: Marc 'BlackJack' Rintsch <marc1rintsch.de>
Date: 2013-06-29 12:28:58
On 29/06/13 04:49, Jim Brain wrote:
> On 6/28/2013 5:35 PM, Groepaz wrote:
>> ie: the key "trick" is to avoid using ANYTHING that uses standard file
>> access.
>> use conio.h for screen exclusively. use cbm_.. functions for disk. forget
>> printf, forget fopen :)
> Understood.  I just put them in the template as a placeholder so the
> entire thing would compile and run first time out.
> 
> I was just not expecting that you can't use stdio AT ALL on an
> unexpanded VIC with a ROM.  That implies printf and software stack takes
> more than 3.5K of RAM.

The size problem is mainly with `printf()` and not stdio stuff in
general.  Using `printf()` pulls all the formatting related code that is
possible with this function into the binary, e.g. converting signed and
unsigned numbers to decimal and hexadecimal, left/right padding with
zeroes or spaces and so on.  Even in a hello world type of program just
printing a fixed string without any formatting place holders.

So unless someone offers a patch that makes the compiler smart enough to
include only the formatting code actually used by `printf()` calls,
expect a size bump when using that (and similar) functions.

Ciao,
	Marc 'BlackJack' Rintsch
-- 
A programming language is low level when its
 programs require attention to the irrelevant.
                              -- Alan J. Perlis
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jun 29 12:45:48 2013

This archive was generated by hypermail 2.1.8 : 2013-06-29 12:45:50 CEST