🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #3281

Lattice C V5.0 hello.c -- 132 byte executable

#3281
From: Deven T. Corzine
Date: Thu, 12 Apr 1990 09:36
35 lines
1589 bytes
For the curious, and for an example of a simple program for Lattice
which requires no startup code, here is a "Hello, world!" program
highly optimized for the Amiga environment...  The idea for the
"execute to compile" trick came from "avail.c" in the Examples
directory on Lattice disk 4.  That program is an excellent source of
neat tricks you won't find in the manual...

-- hello.c ------------- [cut here] --------------------------------
; /* execute to compile
lc -v -j73 -cus hello.c
blink hello.o to hello sc sd nd
delete hello.o
protect hello +p
quit
*/

#include <proto/exec.h>
#include <proto/dos.h>
#define MSG "Hello, world!\n"

main()
{
   struct DosLibrary *DOSBase;

   if (!(DOSBase=(struct DosLibrary *) OpenLibrary(DOSNAME,0))) return(1);
   Write(Output(),MSG,sizeof(MSG));
   CloseLibrary((struct Library *) DOSBase);
   return(0);
}
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.
Technical Details
Message-ID: <DEVEN.90Apr12053750@netserv2.rpi.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!netserv2!deven

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!netserv2!deven
From: deven@rpi.edu (Deven T. Corzine)
Newsgroups: comp.sys.amiga.tech
Subject: Lattice C V5.0 hello.c -- 132 byte executable
Message-ID: <DEVEN.90Apr12053750@netserv2.rpi.edu>
Date: 12 Apr 90 09:36:54 GMT
Distribution: comp
Organization: Rensselaer Polytechnic Institute, Troy, NY
Lines: 35