This is one of those fun questions, and, as always, the answers are misleading.
a true DOS COM file has no headers and should fit inside one memory segment because it did not have moving information, DOS had to put the file where it was needed, and therefore the only true way to be compatible (with x86) was to use assembly compatible with 8086. Edit: To clarify this, this is because the 8086 did not have memory pages.
You could compile on operands 286/386, as soon as the program is launched, there is no runtime in DOS to stop you and say "no, you cannot do this, this is instruction 386".
Which, oddly enough, is part of the reason COM files do not work very often on Windows7 x32, or even on Windows7 x64.
Because DOS worked, command.com was unloaded during the execution of your .com file and subsequently reloaded, so essentially your .com file could access all system memory, and theoretically use DOS memory extensions such as Phar lap DOS / 4GW and CWSDPMI.
In short; you can use any commands that the current system could support, but you should only use 16-bit x86 compatible commands.
If the above sounds like PITA, this is because it was, I remember :) This is also why the .EXE format is very popular very quickly.
Russ Clarke
source share