If you are learning the assembly language basics, you should give a try with emu8086: it is a tool dedicated to assembly learning that features a Masm compatible assembler with support for macros (it can also support fasm syntax) and a 8086 cpu simulator with DOS screen emulation to test / debug your work.
It makes it possible to produce 16 bit COM programs, old fashioned EXEs and even boot sectors.
The sample program that you show in your question assembles without problem with that tool.