home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 1 / ACE CD 1.iso / files / utils / devpac21.dms / in.adf / examples / demo.s next >
Encoding:
Text File  |  1989-06-21  |  1.3 KB  |  60 lines

  1.     opt    l-,c+,d+        nolink,case dependant,debug
  2.     opt    e-            disable Even checks
  3.  
  4. * this source code (C) HiSoft 1987 All Rights Reserved
  5. * a simple demo program to print a message on the screen then quit
  6. * it uses the DOS and EXEC libraries.
  7.  
  8. ************************ IMPORTANT **************************
  9. * this Tutorial is not valid for 68020/030/040 users; sorry *
  10. ************************ IMPORTANT **************************
  11.  
  12.  
  13.     incdir    ":include/"        where to look
  14.  
  15.     include    exec/exec_lib.i        I want to call EXEC
  16.     include    libraries/dos_lib.i    and DOS
  17.     include    libraries/dos.i
  18.  
  19. * start by opening the DOS library
  20. start    move.l    dosname,a1
  21.     moveq    #0,d0            any version
  22.     CALLEXEC OpenLibrary
  23.     tst.l    d0
  24.     beq    quit_fast        quit if cant
  25.  
  26.     move.l    d0,_DOSBase        save pointer
  27.  
  28. * now find our output handle
  29.     CALLDOS    Output
  30.     move.l    d0,d4            d4=output handle
  31.  
  32. * and print a message
  33.     move.l    d4,d1            file handle
  34.     move.l    #string,d2        address of message
  35.     moveq    #stringlen,d3        length
  36.     CALLDOS    Write            and send it
  37.  
  38. * dont close the output handle otherwise the CLI bombs!
  39.  
  40.  
  41. * finished so close DOS library
  42.     mov.l    _DOSBase,a1
  43.     CALLEXEC CloseLibrary
  44.  
  45. quit_fast
  46.     rts                and finish
  47.  
  48. _DOSBase    dc.l    0        space for pointer
  49.  
  50. * strings here
  51.  
  52. string    dc.b    'A Program written with HiSoft''s Devpac Amiga',10
  53. stringlen    equ    *-string
  54.  
  55. * this defines the name of the DOS library
  56. dosname    DOSNAME
  57.  
  58.     even
  59.  
  60.