Mail Archives: djgpp/1998/04/01/08:16:36
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 -