home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 9.ddi / CHAPXMPL.ZIP / STDSEG.ASM < prev    next >
Encoding:
Assembly Source File  |  1991-02-13  |  882 b   |  25 lines

  1. ; Turbo Assembler    Copyright (c) 1988, 1991 By Borland International, Inc.
  2.  
  3. ; STDSEG.ASM - Show "Hello, world" in a program uses standard segments.
  4.  
  5. StkSeg  SEGMENT PARA STACK 'STACK'
  6.         DB      200h DUP (?)
  7. StkSeg  ENDS
  8.  
  9. Data    SEGMENT WORD 'DATA'
  10. HelloMessage    DB      'Hello, world',13,10,'$'
  11. Data    ENDS
  12.  
  13. Code    SEGMENT WORD 'CODE'
  14.         ASSUME  CS:Code, DS:Data
  15. ProgramStart:
  16.         mov   ax,Data
  17.         mov   ds,ax                    ;set DS to the Data segment
  18.         mov   dx,OFFSET HelloMessage   ;DS:DX points to the hello message
  19.         mov   ah,9                     ;DOS print string function #
  20.         int   21h                      ;print the hello string
  21.         mov   ah,4ch                   ;DOS terminate program function #
  22.         int   21h                      ;end the program
  23. Code    ENDS
  24.         END   ProgramStart
  25.