Hi, comments embedded. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Arkady V.Belousov > Sent: Tuesday, February 03, 2004 6:39 AM > To: [EMAIL PROTECTED] > Subject: Re: [Freedos-devel] Q: watcom > > 3-Фев-2004 07:46 Arkady V.Belousov wrote to > [EMAIL PROTECTED]: > > AVB> - with BC stack size may be defined (in source!) by next definition: > AVB> extern unsigned _Cdecl _stklen = ...; > AVB> How do this in Watcom? Which default stack size in Watcom > (and where this > AVB> explained)? > > BTW, lguide.ihp says that I may increment stack size by OPTION STACK, > but this option affects only .EXE format header. .COM files with and w/o > this option are equal. I found in cstart_t.obj mention for > __stacksize, but > in cstrt086.asm I see that it valid only with "__TINY__", and > this variable > not explained/mentioned anywhere else (not in *.h nor *.ihp).
TINY is the name of the memory model for COM style executable under DOS. If you pass option /mt (or something like that) to the compiler, it will automatically define __TINY__ (or some other similar variable). Note that TINY is essentially SMALL with a different startup code to cope with the CS = DS = SS prerequisite of COM executables (the classic "no stack" linker warning), and some other things, like code+data+stack <= 64K (so the linker can refuse to link bigger executables) and all free memory allocated to the program by default by the OS (so the startup code should shrink to the maximum needed memory). [...] > AVB> - BCC generates 9148 bytes of ATTRIB.COM (7306 with > redifinition for some > AVB> RTL functions), Watcom generates 10296 bytes of ATTRIB.EXE > (with WPP > > ...and 10116 for ATTRIB.COM. Of course - with same object file (in > small memory model) difference is only in .EXE header (64 bytes) and in > different startup modules (for .COM - cstart_t.obj; for .EXE comes from > clibs.lib?). I don't know watcom, but I think it should use some cstart_*.obj for every memory model used: t - tiny, s - small, m - medium, c - compact, l - large, h - huge. All the models generate EXE files, but only the tiny model can generate COM files (or tiny EXE files can be converted to COM files with an utility called EXE2BIN), in some circumstances (see above). And, yes, the differences between a tiny model EXE and COM is mainly the EXE header. To know where resides the ~1K of difference between BCC executable and WCC executable more info is needed. Ciao. ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
