On Tue, 3 Feb 2004, Arkady V.Belousov wrote: > - with BCC defaults for options may be written in turboc.cfg. How to reduce > command line in Watcom? Where (in which .ihp file) this explained (if this > possible at all)?
environment variables or @file cguide.ihp has this information, look for the WCC env variable. This help file also tells you how #pragma works and various other optimization effects. Look for instance at "Describing how functions use memory". > - with BC stack size may be defined (in source!) by next definition: > extern unsigned _Cdecl _stklen = ...; > How do this in Watcom? Which default stack size in Watcom (and where this > explained)? There is the option stack=nnnn for the linker. Note that memory is organized differently; IIRC in small model for Turbo C you have (for the data segment): data - BSS - heap - stack whereas for Watcom it's data - BSS - stack - heap so you cannot dynamically change the stack size. default is stack size = 4096 (see the map file) > - how to compile .COM files? With command line > wlink form dos com file attrib.obj > wlink gives some errors about "segment relocation", then "stack segment > ignored", then page fault. Without "com" in command line, wlink generates > .exe file. With "sys com" instead "form dos com" wlink says "undefined > system name". In your example there must be something in the object that causes a segment relocation. You'll have to strip it down to find out where; it shouldn't happen for "hello world". > - when I run wlink without LIB environment variable, it can't find > libraries. Bug (ignored libpath in wlink.lnk/wlsystem.lnk)? (Of course, > WATCOM variable is defined). If you just use "form dos" or "form dos com" then it cannot find the libraries. wlink sys com f hello.obj should work without a LIB environment variable though -- I see that WLINK looks for wlink.lnk in the PATH (explained in lguide.ihp) > - BCC generates 9148 bytes of ATTRIB.COM (7306 with redifinition for some > RTL functions), Watcom generates 10296 bytes of ATTRIB.EXE (with WPP > options -ms-ox). How I may reduce size of executables? -ox isn't the best for codesize. It does -obmiler -s; wpp does -obmilr -s. Anyway, -os -s or -oas -s or -oals -s will generally be smaller. Also watcom's printf is fairly large since it deals with 64-bit integers (long long) and wide characters. Have a look at the map file; perhaps you can replace a few functions by stubs. Replacing printf, malloc and free, and getenv (as is done in SYS; because Watcom follows MS here and made getenv case-insensitive a whole bunch of uppercase tables had to be linked in) makes quite a difference. getcmd() instead of main(argc, argv) can also reduce the size -- but it means you have to reorganize your option processing. the *o* libaries deal with overlays. The normal way to use the openwatcom people is through the news server (NNTP: news.openwatcom.org, groups openwatcom.users.c_cpp and openwatcom.contributors). Not sure if you can reach that, there may be mail-to-news gateways but I don't know. There's also a bugzilla just like for freedos. Bart ------------------------------------------------------- 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