Date: Thu, 25 Sep 1997 10:11:14 +0000 ( ) From: "Gurunandan R. Bhat" To: Charles Sandmann Cc: djgpp AT delorie DOT com Subject: Re: hello.s, anyone? In-Reply-To: <34285530.sandmann@clio.rice.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 23 Sep 1997, Charles Sandmann wrote: > > This message concerns a quest that some may find challenging, some > > humorous, and some rather dubious: the road to a standalone hello.s > > gcc -c hello.s > ld -s hello.o -o hello > stubify hello > > On the file below (hello.s) will produce a 2560 byte executable, the > smallest valid DJGPP image. Thank you for posting this amazing *gem*, not so much for its code (which is very cute and not silly as you say, at all) but its method of compilation. What I find aboslutely awesome is the manner in which the exe is created. It's my first exposure to a program without crt0.o (its size itself would have been 3196 bytes). I never thought it possible!!! This is a program that needs no sbrk or any other crt0 service to allocate space for variables because the assembler reserves space for L1. Right? Who (What) sets the segment registers, stub.asm? It doesn't need a main because it is crt0.o that calls main. Right? And is it stub.asm that calls "start"? Amazing! Thank you once again for posting this, and with warmest regards. Gurunandan