delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/25/11:10:25

Date: Thu, 25 Sep 1997 10:11:14 +0000 ( )
From: "Gurunandan R. Bhat" <grbhat AT unigoa DOT ernet DOT in>
To: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Cc: djgpp AT delorie DOT com
Subject: Re: hello.s, anyone?
In-Reply-To: <34285530.sandmann@clio.rice.edu>
Message-Id: <Pine.LNX.3.91.970925095607.2058A-100000@aditya.unigoa.ernet.in>
Mime-Version: 1.0


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

- Raw text -


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