<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 03 Jul 2005 17:25:35 +0100
From   : jgh@... (Jonathan Graham Harston)
Subject: Re: Small-C v0.73

Richard Gellman <splodge@...> wrote:
> >Yes, with the -R flag: tcc -o rom -R rom/s
> >
> >stand-alone program weighs in at 13K!
> >
> Ouch. That doesnt leave much room in a ROM for actual code....
 
A very very crude test, manually linked together to include only
the code required as a stand-along program, the previously
mentioned demo program comes to about 3K:
 
 556#include <bbcrom.h>
#include <bbcio.h>
  18  extern os_byte();
  13  extern os_rdch();
#include <stdio.h>
2700  extern printf();
 
  62main() {
int c;
 
   6printf("Hello there.\n");
  14
   6
   6
   3os_byte(13,6);
do {
   3  c=os_rdch();
   6
  14
   6  printf("char=%x  esc=%x\n",c,os_escape());
  17
  18  os_byte(126,0);
   9  } while (c != 0x20);
 
   9return 0;
}
----
3466
 
As you can see, fprint() takes up the vast bulk of that at about
2700 bytes. If printf() wasn't used and custom-rolled prstr() and
prhex() routines instead it would probably come to about 600
bytes.
 
I'm working on a C ROM Header Generator (a counterpart to the C
Module Header Generator) to make building ROMs easier. At the
moment the -R option builds a language ROM entered with the '*sh'
command and nothing else...
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
Sheffield Boundary Review at http://mdfs.net/User/JGH/Docs/Politics/ParlReview
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>