Path: utzoo!utgpu!cs.utexas.edu!swrinde!mips!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!cs.umu.se!dvljrt From: dvljrt@cs.umu.se (Joakim Rosqvist) Newsgroups: alt.sources.amiga Subject: Short Hello World Message-ID: <1991May2.102554.8679@cs.umu.se> Date: 2 May 91 10:25:54 GMT References: <1991Apr30.213936.22878@ux1.cso.uiuc.edu> Sender: news@cs.umu.se (News Administrator) Organization: Dep. of Info.Proc, Umea Univ., Sweden Lines: 43 >Well, you are now: > >Use `lc -. -v -cus hello.c >nil:' [-O does't help ;-] > `blink from hello.o nd quiet' >with SAS/C v5.0a (with 2.0 includes) to get an executable that is >124 bytes long... ...which is smaller than Mike's hand coded 180. :-) >This may suprise a guy like Mike. :-) >And, boy is the source more readable... :-) >[Mike this was meant in good fun - ljr ;-] > >// [non-portable because we call AmigaOS functions directly instead of >// using the ANSI library and we use those snazzy C++ style comments. ;-] >// >// Programmed by Loren J. Rittle in more than 1 minute (but that is all it >// would take next time :-). >// >// compiles and links into a 124 byte executable (62 byte codesize) >// in .733 seconds (yes, Mike, I changed the time; that's all it took). >// > [some boring C-code deleted] :-) Ok, assembler strikes back with this: (56 codesize, 92 executable) OpenLib=-408 Output=-60 Write=-48 move.l 4.w,a6 lea dos(pc),a1 jsr OpenLib(a6) move.l d0,a6 jsr Output(a6) move.l d0,d1 lea hello(pc),a0 move.l a0,d2 moveq #12,d3 jmp write(a6) dos: dc 'dos.library',0 hello: dc 'Hello World',10 /$DR.HEX$