; sample.asm
; author: j.e.snaird
; date written: 3 november 1997
; function: demonstration of .com code skeleton
program SEGMENT
ASSUME CS:program,DS:program
ORG 100h
start: ;instruction mnemonics start here
INT 20h ;program termination
;alternately MOV AH,00 then INT 21h
;or MOV AH,4Ch, MOV AL,00, INT 21h
;The INT 20h version is only valid for .COM programs
;---typically some data items would then be defined
a_number DW ? ;uninitialized word
a_char DB ? ;uninitialized byte
message DB "life in the fast lane.$" ;initialized string of bytes
program ENDS
END start
; exepgm.asm
; author: j.e.snaird
; date written: 3 november 1997
; purpose: demonstrate sample .exe source code structure
dseg SEGMENT
some_val DW 0
another DB "A"
two_lines DB "3 blind pigs",0Dh,0Ah,"See how they run",0Dh,0Ah,"$"
dseg ENDS
cseg SEGMENT
ASSUME CS:cseg
begin: MOV AX,SEGMENT dseg ;reset DS to point to data segment
MOV DS,AX
ASSUME DS:dseg ;now safe for program to assume DS points here
;-----
;-- other code --
MOV AH,4Ch ;terminate with return code option value
MOV AL,00h ;return code of zero
INT 21h
cseg ENDS
sseg SEGMENT STACK
DW 256 DUP (?) ;256 copies ("duplicates") of uninitialized word
; for use as "stack"
;this should be adequate if program does not make
; explicit use of the stack
ENDS
END begin