home *** CD-ROM | disk | FTP | other *** search
-
- name hello
- page 55,132
- title 'HELLO --- print Hello on terminal'
- ;
- ; HELLO utility to demonstrate various parts
- ; of a functional assembly language program,
- ; use of segments, and a PC-DOS function call.
- ;
- ; Ray Duncan, September 1983
- ; Converted to .COM file by Jerry D. Stuckle, April, 1984
- ;
- ;show use of some EQUATES:
- cr equ 0dh ;ASCII carriage return
- lf equ 0ah ;ASCII line feed
- ;
- ;
- ;begin the "Code" segment
- ;containing executable
- ;machine code
- cseg segment para public 'CODE'
- ;
- ; First we need to tell the assembler where the segment registers point.
- assume cs:cseg,ds:cseg,ss:cseg
- ;
- org 100h ;set the start at 0100h (to make room for the PSP)
- ;
- print proc far ;actual program code
- ;is completely contained
- ;in the "procedure" named
- ;"PRINT".
- ;
- ;now put the offset of the
- ;message text into DX,
- mov dx,offset message
- ;now DS:DX specifies the
- ;full address of the message.
- mov ah,9 ;use the PC-DOS function 9
- int 21h ;to print the string.
- ;
- xor ah,ah ;set DOS function 0 (terminate)
- int 21h ;and call DOS to end the program
- ;
- print endp ;end of the "procedure"
- ;named "PRINT"
- ;
- message db cr,lf,'Hello!',cr,lf,'$'
- ;
- cseg ends ;end of the code segment
- ;containing executable
- ;program.
- ;
- ;the final "End" statement
- ;signals the end of this
- ;program source file, and gives
- ;the starting address of
- ;the executable program
- end print
-
-
- Press ENTER to continue: rting address of
- ;the executable program
- end print
-
-
- Press ENTER to continue: