www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/01/08:16:36

Date: Wed, 1 Apr 1998 14:56:06 +0200 (MET DST)
From: Federico Spinazzi <federico AT SysPr03 DOT disat DOT unimi DOT it>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, Nicolas Blais <eletech AT netrover DOT com>,
djgpp AT delorie DOT com
Subject: Re: Why won't this work?
In-Reply-To: <199804010555.VAA22781@adit.ap.net>
Message-ID: <Pine.LNX.3.93.980401143359.15078A-100000@SysPr03.disat.unimi.it>
MIME-Version: 1.0

On Tue, 31 Mar 1998, Nate Eldredge wrote:

> At 02:40  3/30/1998 +0300, Eli Zaretskii wrote:
> >
> >On Mon, 30 Mar 1998, Federico Spinazzi wrote:
> >
> >> You can declare an array for com:
> >> char com[22222222222222];
> >           ^^^^^^^^^^^^^^
> >This is *way* too much.  If you compile such a program it will bomb, 
> >since automatic arrays cannot be larger than 256KB without changing the 
> >default stack size.  See section 15.9 of the DJGPP FAQ list, for more 
> >about this.
> 
> Actually, it's even larger than 2^32, so you'll have to get an Alpha before
> you can compile it. :)
> 
> Nate Eldredge
> eldredge AT ap DOT net
> 
> 
I've not tried it but it should compile:

#include <stdio.h>
#define HOW_MUCH_I_M_STUPID	MAX_INT /* or INT_MAX ?*/

static char message[]=
"This is H M I S - (c) 1998 by Federico Spinazzi\n\
         o a m t\n\
         w c   u\n\
           h   p\n\
               i\n\
               d\n"

int main()
{
int hmis;

	fprintf(stdout,"%s",message);

	fprintf(stdout, "Hit a key to disconnect brain from mouth.\n");
	fflush(stdout);
	getch();

	for(hmis=HOW_MUCH_I_M_STUPID; hmis; hmis--) {
		fprintf(stdout, "Hey, do you know how much I'm stupid
?\n");
		fflush(stdout);
	}
	fprintf(stderr, "Oh yeaH !!\n");
	fflush(stderr);
	exit(0);
} 

compile with -Wall -O3 at least. 
Redirect stdout to a file for speed.
DJGPP will take care to reconnect brain to mouth, so don't worry about it.

When DJGPP'll have 64-bit words, you'll be alble to loop it 22222222222222
times in a single for() (using double will slow CPU with no coprocessor).
In the mean time you can nest loop one into each other.

(Future releases of H M I S will include a multi-threading version)

PS: I'm sorry, really.

Federico Spinazzi.

- Raw text -


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