About me
Home
Resumé
CV
Pictures

Course Work
CSE300-FA98

Teaching
Portfolio
CSE240-SP99
CSE207-FA03

Misc
eHarmony
Documents

Tools

Hello World

Please try out this sample program. This will ensure that your assembler and linkter are working properly. If you cannot assemble or link these files, please check your path settings. You need to be able to access TASM.exe and TLINK.exe. To download the following file, right-click on the download link and select save to disk.

TITLE hi_world.asm 
;=======================================================================
; Hello World application - prints "Hello World" to the screen
;=======================================================================

;Some Useful Constants
STDIN                   EQU         0
STDOUT                  EQU         1
STDERR                  EQU         2
LF                      EQU         0Ah
CR                      EQU         0Dh

_DATA SEGMENT USE16 BYTE PUBLIC 'DATA'
      myString DB "Hello World", CR, LF, "$"
_DATA ENDS

_TEXT SEGMENT USE16 WORD PUBLIC 'CODE'
   ASSUME cs:_TEXT, ds:_DATA

   Start:
      mov   ax, _DATA           ; set DS to point to our data segment
      mov   ds, ax

      mov   ah, 09h             ; function: print string $ terminated
      mov   dx, OFFSET myString ; pointer to string
      int   21h

      mov   ax, 4C00h           ; function: exit program and return to DOS
      int   21h

_TEXT ENDS

_STACK SEGMENT USE16 STACK 'STACK'
      DW  100 dup(?)
_STACK ENDS

END Start
Last Modified: January 26, 1999 - Barry E. Mapen