3

I'm trying to make a small utility for an old i286 machine running PC-DOS and the target format a plain COM executable.

The compiler choice has been Open Watcom and, on the documentation it says it can link DOS .COM files but documentation is either ambiguous or doesn't work as the examples show, so I end up with either a .EXE file (with MZ header) or multiple linker/compiler errors.

So, How can I make a .COM executable with Open Watcom compiler?

NeonMan
  • 623
  • 10
  • 24
  • 2
    compiling and linking using small memory model (Links against lib286, as needed) but it still yields a DOS EXE file. the example shown on the manual ( `>wlink system com file myprog` ) tries to find object files named "Sytem" and "COM" instead of yielding a COM file – NeonMan Sep 25 '17 at 15:11
  • 2
    The documentation example works (links) correctly on one installation (Windows host) but doesn't on another (DOS host)... Not sure what is happening but "it solved itself". Probably a PATH screwup on the nonworking one. – NeonMan Sep 25 '17 at 15:20

2 Answers2

2

The system com option is probably invalid since it is not mentioned in the OpenWatcom manual.

According to the documentation, you should be able to get COM executable using format dos com option for wlink (at least this is what I am successfully using).

pcfist
  • 145
  • 1
  • 3
  • 9
1

I'm using the wcl front end for compiling and linking and the memory model tiny instead of small to get a COM file.

BlackJack
  • 4,476
  • 1
  • 20
  • 25