A typical “Hello World!” assembler program for MS-DOS 6.22. Simple and nothing magical going on here.
.model small ; One data segment and one code segment
.stack
.data
msgText db "Hello World!","$"
.code
.STARTUP
main1 proc
mov ax, @data
mov ds, ax ; DS now at Data segment
lea dx, msgText ; DS:DX now has location of msgTEXT
mov ah, 09 ; 09=Display string at DS:DX to STDOUT
int 21h ; Display the string on DOS interrupt
mov ax, 4c00h ; 4C=Exit Program function
int 21h ; Exit program on this DOS interrupt
main1 endp
end
Don’t have MS-DOS anymore? You can setup Oracle’s VirtualBox application and create an MS-DOS virtual environment on any modern computer. I’ve done this with Linux and Windows variants. Seen below is Windows 10 running a DOS virtual machine, aka VM, within the Oracle VirtualBox product. The above source code is located in the DOS VM directory c:\test. This example here uses the Borland assembler and linker, tasm/tlink, that I previously installed in this DOS VM. Finally running the executable code, hello.exe, the expected results are seen.

