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 / curdir.asm next >
Encoding:
Assembly Source File  |  1990-01-17  |  1.5 KB  |  40 lines

  1. **************************************************************************
  2. *
  3. *                  CURDIR  by Jim Locker, SofTech Inc.
  4. *                          17 January, 1990
  5. *
  6. *                  called from AbSoft Fortran
  7. *                  calls system CurrentDir routine
  8. *                  Needed because Amiga.sub does it wrong.
  9. *
  10. *                  USAGE:
  11. *
  12. *                    OldDir = CURDIR(LOCK)
  13. *
  14. *                    where LOCK is a directory lock
  15. *
  16. ***************************************************************************
  17.  
  18. AEXEC   EQU     -16                     * "exec_lib" pointer
  19. DOS     EQU     AEXEC-4                 * "dos.library" pointer
  20. STDIN   EQU     DOS-4                   * file handle for STDIN
  21. STDOUT  EQU     STDIN-4                 * file handle for STDOUT
  22. H.BASE  EQU     STDOUT-4                * base of heap
  23. H.SIZE  EQU     H.BASE-4                * size of heap
  24. WBSTAT  EQU     H.SIZE-2                * running from workbench?
  25. WBMSG   EQU     WBSTAT-4                * loc of WB message
  26. OURTSK  EQU     WBMSG-4                 * loc of our TCB
  27. AMIGA   EQU     -OURTSK                 * size of Amiga global storage
  28.  
  29. _LVOCURRENTDIR  EQU  -126
  30.  
  31. CURDIR:
  32.          MOVEA.L  4(A7),A1       *LOAD POINTER TO LOCK
  33.          MOVE.L  (A1),D1         *LOAD LOCK
  34.          MOVEM.L A0/A4-A6,-(A7)  *SAVE EVERYTHING WE NEED
  35.          MOVEA.L  DOS(A0),A6      *MOVE IN DOS LIB POINTER
  36.  
  37.          JSR     _LVOCURRENTDIR(A6) *CHANGE THE DIRECTORY
  38.          MOVEM.L (A7)+,A0/A4-A6  *RESTORE EVERYTHING
  39.          RTS
  40.