Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
HELLOC.ASM
◄Example► ◄Back► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
;* HELLOC.ASM illustrates .COM files with full segment directives.
;* Assemble with the "Generate .COM File" linker flag or the
;* /TINY QCL option.
;*
;* Shows: Directives - SEGMENT ASSUME ORG
;*
;* See HELLO.ASM for a simplified segment version or HELLOF.ASM
;* for a full-segment .EXE file version.
_TEXT SEGMENT WORD PUBLIC 'CODE'
ASSUME cs:_TEXT, ds:_TEXT
ORG 100h
first: jmp start ; Jump over data
msg DB "Hello, world.", 13, 10, "$"
start: mov ah, 9h ; Request DOS Function 9
mov dx, OFFSET msg ; Load DX with offset of string
; (segment already in DS)
int 21h ; Display String to Standard Output
mov ax, 4C00h ; Exit functions with 0 in AL
int 21h ; Exit Program with Return Code
_TEXT ENDS
END first
-♦-