The most likely place this should go is at https://github.com/bartoldeman/freecom/blob/master/shell/command.c#L221 This calls into https://github.com/bartoldeman/freecom/blob/master/lib/exec.c which calls into https://github.com/bartoldeman/freecom/blob/master/lib/lowexec.asm
Test case:
C:\>ver /r FreeCom version 0.84-pre2 XMS_Swap [Aug 28 2006 00:29:00] DOS version 7.10 FreeDOS kernel 2042 (build 2042 OEM:0xfd) [compiled May 11 2016] C:\>type testoom.asm dw "MZ" times 510 db -1 C:\>nasm testoom.asm -o testoom.exe C:\>testoom C:\>
Expected: An error message about the program not fitting into memory.
Originally reported at https://github.com/bartoldeman/freecom/issues/1
Bart has been doing some work recently on the kernel and command.com, so I'm assigning to him.
Fixed in 0.83pre5.