home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_oth / amigalib.lzh / AMIGALIB / AMIGALIB.LZH / asm_source / wbstrt.asm < prev   
Encoding:
Assembly Source File  |  1990-01-17  |  1.5 KB  |  48 lines

  1. **********************************************************************
  2. *
  3. *   WBStrt version 1.1
  4. *
  5. *   Bring the location of a Workbench startup message into a Fortran 
  6. *   application
  7. *
  8. *   Author:  Jim Locker, SofTech Inc.  Published in Amazing Computing.
  9. *
  10. *   This program is placed in the public domain.  Use as you see fit, but
  11. *   the author accepts no liability for anything.
  12. *
  13. *   Usage:
  14. *
  15. *          INTEGER*4 Message
  16. *          Message = CALL WBStrt
  17. *
  18. *   Change history:
  19. *
  20. *    14 June 1989  Modified to return a 0 if not started from workbench
  21. *
  22. *****************************************************************************
  23.  
  24.  
  25. AEXEC   EQU     -16                     * "exec_lib" pointer
  26. DOS     EQU     AEXEC-4                 * "dos.library" pointer
  27. STDIN   EQU     DOS-4                   * file handle for STDIN
  28. STDOUT  EQU     STDIN-4                 * file handle for STDOUT
  29. H.BASE  EQU     STDOUT-4                * base of heap
  30. H.SIZE  EQU     H.BASE-4                * size of heap
  31. WBSTAT  EQU     H.SIZE-2                * running from workbench?
  32. WBMSG   EQU     WBSTAT-4                * loc of WB message
  33. OURTSK  EQU     WBMSG-4                 * loc of our TCB
  34. AMIGA   EQU     -OURTSK                 * size of Amiga global storage
  35.  
  36. * - from "dos.library"
  37.  
  38.  
  39. WBStrt:
  40.          tst.w WBSTAT(A0)                   * did we start from workbench?
  41.          bne.s contnu                       * no.
  42.          moveq #0,D0                        * return a 0
  43.          rts
  44.  
  45. contnu:
  46.          move.l WBMSG(A0),D0
  47.          rts
  48.