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

  1. ; Turbo Assembler    Copyright (c) 1988, 1991 By Borland International, Inc.
  2.  
  3. ; HELLOPRN.ASM - Display "Hello World" on the printer
  4.  
  5. ; From the Turbo Assembler Users Guide - Getting started
  6.  
  7.    DOSSEG
  8.    .MODEL SMALL
  9.    .STACK 100h
  10.    .DATA
  11. HelloMessage DB 'Hello, world',13,10,12
  12. HELLO_MESSAGE_LENGTH EQU $ - HelloMessage
  13.    .CODE
  14.    mov  ax,@data
  15.    mov  ds,ax                        ;set DS to point to the data segment
  16.    mov  ah,40h                       ;DOS write to device function #
  17.    mov  bx,4                         ;printer handle
  18.    mov  cx,HELLO_MESSAGE_LENGTH      ;number of characters to print
  19.    mov  dx,OFFSET HelloMessage       ;string to print
  20.    int  21h                          ;print "Hello, world"
  21.    mov  ah,4ch                       ;DOS terminate program function #
  22.    int  21h                          ;terminate the program
  23.    END
  24.