home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 122.lha / Arp_v1.1 / Libraries / Manx_SRC / resgeta4.s < prev    next >
Encoding:
Text File  |  1986-11-21  |  1.1 KB  |  55 lines

  1. ; resgeta4.s -- This is needed for programs which intend to run as
  2. ;               resident using ARP.  Note that this does not
  3. ;        require an opened arp.library.
  4. ;
  5. ; Created 02-18-88 by -+=SDB+=-
  6. ; Copyright (c) by Scott Ballantyne, may be freely used
  7. ; by Arp Supporters/users.
  8. ;
  9. ; Use at your own risk.
  10. ;
  11.  
  12.     INCLUDE    "exec/types.i"
  13.     INCLUDE    "exec/exec_lib.i"
  14.     INCLUDE    "exec/execbase.i"
  15.     INCLUDE "exec/memory.i"
  16.     INCLUDE    "exec/tasks.i"
  17.     INCLUDE    "exec/alerts.i"
  18.     INCLUDE    "libraries/arpbase.i"
  19.  
  20.     cseg
  21.  
  22.     public    _geta4
  23. _geta4:
  24.     far    data
  25.     movem.l    d0-d1/a0-a1/a6,-(sp)    ; max safety here...
  26.     tst.l    ___fromdisk__
  27.     bne.s    1$
  28.     move.l    4,a6
  29.     move.l    ThisTask(a6),a0
  30.     lea.l    TC_MEMENTRY(a0),a0
  31.     lea.l    PMEM(pc),a1
  32.     SYSCALL    FindName
  33.     move.l    d0,a0
  34.     cmp.w    #2,pm_Num(a0)    ; check for data
  35.     bne.s    1$        ; resident, but no data allocated.
  36.     move.l    pm_Data(a0),a4        ; get data pointer
  37.     add.l    #32766,a4        ; bias 
  38.     bra.s    2$
  39. 1$:    lea.l    __H1_org+32766,a4
  40. 2$:    movem.l    (sp)+,d0-d1/a0-a1/a6
  41.     rts
  42.  
  43. PMEM    PMEM_NAME
  44.  
  45.  
  46.     near    data
  47.  
  48.     dseg    
  49.     ds    0
  50.     public    ___fromdisk__,__H1_org
  51. ___fromdisk__:
  52.     dc.l    0    ; default is resident
  53.  
  54.     
  55.