Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!think!nike!lll-crg!lll-lcc!well!ewhac From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Newsgroups: net.micro.amiga Subject: Re: printf() code size using Astartup.obj and AMIGA.LIB only Message-ID: <1384@well.UUCP> Date: Thu, 3-Jul-86 01:52:58 EDT Article-I.D.: well.1384 Posted: Thu Jul 3 01:52:58 1986 Date-Received: Fri, 4-Jul-86 02:13:27 EDT References: <8606270438.AA07486@pavepaws> <562@3comvax.UUCP> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Whole Earth Lectronic Link, Sausalito CA Lines: 50 [ Sorry, but the line eating bug is on a diet. ] In article <562@3comvax.UUCP> mykes@3comvax.UUCP (Mike Schwartz) writes: >In article <8606270438.AA07486@pavepaws> dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) writes: >> This should lay to rest any further arguments about printf(). >>(linking only with AMIGA.LIB and Astartup.obj, Lattice C 3.03) >> >>source executable >>main() {} 1880 >>main() {printf("hello\n");} 2376 >> >> As you can see, printf() takes 496 bytes, PERIOD, when called from >>amiga.lib (it may or may not use the DOS run-time library, but that doesn't >>really matter). >> -Matt >Is there any chance that Amiga.lib's printf() calls a printf() that is in >rom somewhere (like in ROMWack???)? It does not make sense that even a >simple printf() would be so small. Part of Kiskstart is, in fact, the debugging library. The routines documented in debug.lib are: KDoFmt: Format data into character stream KGetChar: Get a character from the debug console (9600 baud terminal) KMayGetChar: Return char from debug console iff present (doesn't block) KPutChar: Send character to debug console KPutFmt: Print formatted data to debug console KPutStr: Put a string to debug console I'm sure they figured out a way to fool these routines into doing the formatting without sending data to the debug console (KDoFmt is probably the key). Note: This is all educated guessing, so I'm obviously wrong. For more complete information on the debugging library, check the pages just before Appendix G in the RKM, vol 2. -------- On a completely different tack: What is the Clist library for? Yes, I know what it does (the auto docs explain that), but what's it *for*? I'm having trouble discovering a use for it. Is it for manipulating a list of strings, or what? [[ the Clist.lib autodocs start at page A-47, RKM, vol 2 ]] _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab ihnp4!ptsfa!well!ewhac ..or.. "Work FOR? I don't work FOR well ---\ anybody! I'm just having fun." dual ----> !unicom!ewhac hplabs -/ ("AE-wack")