home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / ATX-DP31.DMS / in.adf / Devpac / Examples / demo.s < prev    next >
Encoding:
Text File  |  1994-12-16  |  1.2 KB  |  56 lines

  1. ***
  2. *** THIS PROGRAM INCLUDES DELIBERATE ERRORS; IT IS DESIGNED FOR USE
  3. *** IN CONJUNCTION WITH THE TUTORIAL IN THE MANUAL!!!
  4. ***
  5.  
  6.     opt    l-,c+,d+        nolink,case dependant,debug
  7.     opt    e-            disable Even checks
  8.  
  9. * this source code (C) HiSoft 1992 All Rights Reserved
  10. * a simple demo program to print a message on the screen then quit
  11. * it uses the DOS and EXEC libraries.
  12.  
  13.  
  14.     include    /system            use the pre-assembled header
  15.  
  16. * start by opening the DOS library
  17. start    move.l    dosname,a1
  18.     moveq    #0,d0            any version
  19.     CALLEXEC OpenLibrary
  20.     tst.l    d0
  21.     beq    quit_fast        quit if cant
  22.  
  23.     move.l    d0,_DOSBase        save pointer
  24.  
  25. * now find our output handle
  26.     CALLDOS    Output
  27.     move.l    d0,d4            d4=output handle
  28.  
  29. * and print a message
  30.     move.l    d4,d1            file handle
  31.     move.l    #string,d2        address of message
  32.     moveq    #stringlen,d3        length
  33.     CALLDOS    Write            and send it
  34.  
  35. * dont close the output handle otherwise the CLI bombs!
  36.  
  37.  
  38. * finished so close DOS library
  39.     mov.l    _DOSBase,a1
  40.     CALLEXEC CloseLibrary
  41.  
  42. quit_fast
  43.     rts                and finish
  44.  
  45. _DOSBase    dc.l    0        space for pointer
  46.  
  47. * strings here
  48.  
  49. string    dc.b    'A Program written with HiSoft''s Devpac Amiga',10
  50. stringlen    equ    *-string
  51.  
  52. * this defines the name of the DOS library
  53. dosname    DOSNAME
  54.  
  55.     even
  56.