Author Topic: Why does DOS keep thinking my COM file is too big?  (Read 13219 times)

Offline ben321

  • Full Member
  • **
  • Posts: 185
Why does DOS keep thinking my COM file is too big?
« on: March 28, 2015, 12:19:16 AM »
The program I wrote compiled to a file size of 65,306 bytes which is only 63.8kbytes. This is smaller than the maximum allowed size for a COM file, which is 64kbytes. Please help.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Why does DOS keep thinking my COM file is too big?
« Reply #1 on: March 28, 2015, 05:38:45 AM »
I confess I have never succeeded in installing DosBox. I do have the source. This from src/dos/dos_programs.cpp:

Code: [Select]
fseek(tmpfile, 0L, SEEK_END);
if (ftell(tmpfile)>0x10000) {
LOG_MSG("BIOS file too large.");
return;
}

Does that look like the error message you're seeing? Possible that DosBox is adding something to its "tmpfile" that isn't in your .com file?

The only thing I can suggest is to remove data until you find out what DosBox WILL eat...
Code: [Select]
...
imagedata:
%if 0
; some few lines of data
%endif ; move this line down until DosBox capitulates
...

That won't actually solve your problem, of course, but it might help narrow down just what DosBox is having a problem with. (then maybe file a bug report?) Sorry I can't help you more, but I've never seen anything like this...

Best,
Frank


Offline ben321

  • Full Member
  • **
  • Posts: 185
Re: Why does DOS keep thinking my COM file is too big?
« Reply #2 on: March 28, 2015, 05:54:44 AM »
It's not DosBox that's the problem. I remember reading that there's a limit that DOS has on the size of COM files. In fact if DosBox has this issue, it's simply correctly emulating a DOS computer, as it should. However, despite the complete lack of responses from people here (despite asking what that limit is, so I could fix my program, and nobody ever replying and telling me that limit), I managed to after HOURS of searching, finally figure it out what that limit is. The maximum size of a DOS COM file is exactly 65,280 bytes according to a Wikipedia article I finally found that had this info.