.COM files are loaded into a new segment with offset
0x100. You can write .COM files if you have any
16bit x86
assembler that can output binary files,
just remember to offset 0x100 at the beginning.
A ret instruction will return to the operating
system, as will the widely used mov ax, 4c00h; int 21h. IIRC, you have all memory auto-allocated to your program from the segment you're loaded in, to the top of 640kb.
.COM files can still be fun and/or useful to write
since they have a smaller (0 byte) header, compared to .exe files.
If you search the internet, you should be able to
find several size coding competitions where the
winner is the person to write the smallest program to
do some specific task, such as displaying the flag of Japan, a Brainfuck interpreter, etc.