on-internet
← Community

How to create DOS .com file with OpenWatcom `owcc`, but without the OpenWatcom libc?

Stack Overflow ·

Here is a short C file cu.c: int main(int argc, char **argv) { (void)argc; (void)argv; return 0; } When I compile it with OpenWatcom to a DOS .com file, the result is almost 3 KiB: $ owcc -bcom -mcmodel=t -fno-stack-check -Os -s -march=i86 -W -Wall -Wextra -o cu.com cu.c $ ls -l cu.com -rwxr-x--- 1 pts pts 2938 Jun 20 19:26 cu.com The smallest possible DOS .com file which does the same (just exits) is 1 byte long: it contains a single ret instruction (byte 0xc3). How can I compile my cu.c file (with possibly some modifications, I don't care about argc or argv) to a smaller DOS .com file, witho

Comments

Sign in or sign up to comment and upvote.

No comments yet.