Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!think.com!mintaka!geech.ai.mit.edu!rjc From: rjc@geech.ai.mit.edu (Ray Cromwell) Newsgroups: comp.sys.amiga.programmer Subject: Re: How are some programs SO DAMN SMALL! Message-ID: <1991Feb14.234240.7920@mintaka.lcs.mit.edu> Date: 14 Feb 91 23:42:40 GMT References: <91042.134209J56QC@CUNYVM.BITNET> <16689@sdcc6.ucsd.edu> Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius) Organization: None Lines: 37 In article <16689@sdcc6.ucsd.edu> djohnson@beowulf.ucsd.edu (Darin Johnson) writes: >In article mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) writes: >>Example: I just spent 30 seconds turning out a "hello world" program >>in a language chosen to 1) be portable, and 2) generate small >>executables. The executable is 20 bytes long. How small is your best >>assembler effort? > >Ooooo, you FORTH people can be so smug... Forth programs need an interpreter. Even using assembly, a 20 byte hello world is impossible. The smallest program I know of is 'Lab', 'EndIf' etc in C: These programs (ARP) are nothing more then a NOP and RTS. However when the hunks are added to the file it becomes 40 bytes long. An assembly hello_world would look like jsr Output(a6) move.l d0,d1 move.l hello,d2 moveq.b #13,d3 jsr Write(a6) rts hello dc.b "hello world",0 This code + hunks would be larger than 40 bytes atleast. (note, its possible to make this code smaller, and jump directly into rom. No sane programmer would do that unless he was brainwashed by the writers of the abacus books. I also left out the code to get DosBase into a6, since I forgot the trick optimization to fetch it from ExecBase.) > >(well, how many bytes in BASIC? 16?) >-- >Darin Johnson >djohnson@ucsd.edu > - Political correctness is Turing undecidable.