Path: 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: Date: 12 Apr 90 09:36:54 GMT Distribution: comp Organization: Rensselaer Polytechnic Institute, Troy, NY Lines: 35 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 #include #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.