delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/19/15:39:55

Date: Thu, 19 Jul 2001 15:38:15 -0400
Message-Id: <200107191938.PAA22366@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
CC: eliz AT is DOT elta DOT co DOT il, djgpp AT delorie DOT com
In-reply-to: <bc.17884332.28888d5d@aol.com> (Sterten@aol.com)
Subject: Re: pokeb peekb
References: <bc DOT 17884332 DOT 28888d5d AT aol DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

>  >#include <pc.h>
>  >#include <conio.h>
>  >#include <crt0.h>
>  >
>  >char **__crt0_glob_function (char *arg) { return 0; }
>  >void   __crt0_load_environment_file (char *progname) { }
>  >void   __crt0_setup_arguments (void) { }
>  >
>  >int main()
>  >{
>  >  ScreenPutChar('\001', WHITE, ScreenCols()/2, ScreenRows()/2);
>  >  return 0;
>  >}
> 
> but the code is longer and more complicated (for me) .

The lines that have __crt0 in them exist *only* to reduce the size of
the final executable (the FAQ tells you all about this).  A shorter
source that produces a larger executable would be:

#include <pc.h>
#include <conio.h>

int main()
{
  ScreenPutChar('\001', WHITE, ScreenCols()/2, ScreenRows()/2);
  return 0;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019