home *** CD-ROM | disk | FTP | other *** search
/ The Party 1994: Try This At Home / disk_image.bin / source / asmvla00 / asm1.asm < prev    next >
Assembly Source File  |  1993-03-21  |  831b  |  25 lines

  1.     DOSSEG
  2.     .MODEL SMALL
  3.     .STACK 200h
  4.     .DATA
  5.  
  6. Message     db  "This was printed using function 9 " 
  7.             db  "of the DOS interrupt 21h.$"
  8.                   
  9.     .CODE
  10.     
  11. START:
  12.     mov     ax,seg Message  ;moves the SEGMENT that `Message' is in into AX
  13.     mov     ds,ax           ;moves ax into ds (ds=ax)
  14.                             ;you cannot do this -> mov ds,seg Message
  15.  
  16.     mov     dx,offset Message   ;move the OFFSET of `Message' into DX
  17.     mov     ah,9        ;Function 9 of DOS interupt 21h prints a string that
  18.     int     21h         ;terminates with a "$".  It requires a FAR pointer to
  19.                         ;what is to be printed in DS:DX
  20.  
  21.     mov     ax,4c00h    ;Returns control to DOS
  22.     int     21h         ;MUST be here! Program will crash without it!
  23.  
  24. END START
  25.