It can be done in MASM 5.1 (or older). From the MASM 5.0 docs, here is the basic shell with your test program.
TITLE COMFILE
_TEXT SEGMENT
ASSUME CS:_TEXT,DS:_TEXT,ES:_TEXT,SS:_TEXT
ORG 100H
START:
mov ah,9
mov dx,offset hi
int 21h
mov ax,4c00h
int 21h
hi db 'HELLO','$'
_TEXT ENDS
END START
With the above file named COMFILE.ASM, assemble and convert to .com using the following steps:
A>MASM COMFILE;
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
51668 + 464828 Bytes symbol space free
0 Warning Errors
0 Severe Errors
A>LINK COMFILE;
Microsoft (R) Overlay Linker Version 3.60
Copyright (C) Microsoft Corp 1983-1987. All rights reserved.
LINK : warning L4021: no stack segment
A>EXE2BIN COMFILE.EXE COMFILE.COM
Which should produce:
A>DIR COMFILE.COM
Volume in drive A has no label
Directory of A:\
COMFILE COM 18 01-01-80 12:00p
1 File(s) 30208 bytes free
A>COMFILE.COM
HELLO
A little thread necromancy here, yes. I also wasn't able to find a clear, working example of this elsewhere so hopefully this will help someone in the future.