www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/19/15:23:52

From: Sterten AT aol DOT com
Message-ID: <bc.17884332.28888d5d@aol.com>
Date: Thu, 19 Jul 2001 15:22:05 EDT
Subject: Re: pokeb peekb
To: eliz AT is DOT elta DOT co DOT il, dj AT delorie DOT com
CC: djgpp AT delorie DOT com
MIME-Version: 1.0
X-Mailer: AOL 3.0 16-bit for Windows sub 60
Reply-To: djgpp AT delorie DOT com

DJ Delorie:
 >If you're new to the C language itself, you should learn basic C first
 >(like main and printf), then worry about pc-specific things.

I know some C (not C++) but didn't use it much the last years

 >This one is 26k and far safer:
 >
 >#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) .
But it looks more compatible with other compilers ,
so maybe I'll take it.


Eli:
 >It depends what do they do with DJGPP.  Using low-level functions that 
 >access absolute addresses of video memory is not everyone's idea of using 
 >a compiler ;-)

it's important

 >> here is my final version, it compiles to about 90KBytes.
 >
 >Try stripping it, it will be much smaller.

I don't (already) know how.

 >> sometimes, but not always , I also need for compiling :
 >> #include<farptr.h>
 >
 >You need to include it always.

#include<go32.h> 
int main() { // gcc video3.c -o video3.exe 
_farpokeb(_dos_ds,0xb8000+12*160+40*2,1);}

compiles and runs fine. (gcc2.03)




 >> it adds to the other code. How large can it be ? 500K ?
 >
 >About 25KB.

I meant in total. Actually our program is 478K and I'm starting to worry..

 >FAQ is for FREQUENTLY-asked questions.  This one is only asked once, so 
 >far.  It doesn't qualify.

poking to memory is a rather frequent question, I think.
I found a lot in the mailing list archive  (which contributed
to my confusion)


Guenter

- Raw text -


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