home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk414.lzh / Din / latticeglue.asm < prev    next >
Assembly Source File  |  1990-12-15  |  6KB  |  234 lines

  1. *==================================================*
  2. *                                                  *
  3. *       din library glue code                      *
  4. *       (for Lattice C)                            *
  5. *                                                  *
  6. *       Copyright © 1990 by Jorrit Tyberghein      *
  7. *                                                  *
  8. *==================================================*
  9.  
  10. *--------------------------------------------------------------------*
  11. *                                                                    *
  12. *    To assemble the SMALL_CODE version :                            *
  13. *      asm -oLIB:dinSCglue.o -iINCLUDE: -dSMALL_CODE latticeglue.asm *
  14. *                                                                    *
  15. *    To assemble the LARGE_CODE version :                            *
  16. *      asm -oLIB:dinLCglue.o -iINCLUDE: -dLARGE_CODE latticeglue.asm *
  17. *                                                                    *
  18. *    To use, link with 'LIB:dinSCglue.o' or 'LIB:dinLCglue.o'        *
  19. *                                                                    *
  20. *    (based on ARP glue code, thanks arp (and Nico François) :-)     *
  21. *                                                                    *
  22. *--------------------------------------------------------------------*
  23.  
  24.          IFND LIBRARIES_DIN_LIB_I
  25.          include "libraries/din_lib.i"
  26.          ENDC
  27.  
  28. * First some macros
  29.  
  30. GLUEDEF  MACRO
  31.          XDEF _\1
  32. _\1:
  33. THIS_LIB SET _LVO\1           ; Set the offset to call
  34.          ENDM
  35.  
  36. *
  37. *        Set SMALL_CODE=1 for a4 addressing...
  38. *        Set LARGE_CODE=1 for absolute addressing...
  39. *        if neither, just cause an error...
  40. *
  41.  
  42. CALLDIN MACRO
  43.         move.l  a6,-(a7)        ; Save a6...
  44.  
  45.         IFD     SMALL_CODE
  46.         move.l  _DinBase(a4),a6 ; If a4 addressing....
  47.         ENDC
  48.  
  49.         IFD     LARGE_CODE
  50.         move.l  _DinBase,a6     ; If not a4 addressing...
  51.         ENDC
  52.  
  53.         IFND    SMALL_CODE
  54.         IFND    LARGE_CODE
  55.         moveq.l #12323,a0       ; Cause an error!
  56.         ENDC
  57.         ENDC
  58.  
  59.         jsr     THIS_LIB(a6)
  60.  
  61.         move.l  (a7)+,a6
  62.         ENDM
  63.  
  64. * Now for the actual glue routines
  65.  
  66.         XREF    _DinBase
  67.  
  68.         SECTION "DinGlue",CODE
  69.  
  70. *    ULONG NotifyDinLinks (struct DinObject *, ULONG);
  71. *    D0                    A0                  D0
  72.  
  73.         GLUEDEF NotifyDinLinks
  74.         move.l  4(a7),a0
  75.         move.l  8(a7),d0
  76.         CALLDIN
  77.         rts
  78.  
  79. *    void ResetDinLinkFlags (struct DinLink *);
  80. *                            A0
  81.  
  82.         GLUEDEF ResetDinLinkFlags
  83.         move.l  4(a7),a0
  84.         CALLDIN
  85.         rts
  86.  
  87. *    struct DinObject *MakeDinObject (char *, UWORD, ULONG, APTR, ULONG);
  88. *    D0                               A0      D0     D1     A1    D2
  89.  
  90.         GLUEDEF MakeDinObject
  91.         move.l  d2,-(a7)
  92.         move.l  4+4(a7),a0
  93.         movem.l 4+8(a7),d0-d1/a1
  94.         move.l  4+20(a7),d2
  95.         CALLDIN
  96.         move.l  (a7)+,d2
  97.         rts
  98.  
  99. *    BOOL EnableDinObject (struct DinObject *);
  100. *    D0                    A0
  101.  
  102.         GLUEDEF EnableDinObject
  103.         move.l  4(a7),a0
  104.         CALLDIN
  105.         rts
  106.  
  107. *    BOOL DisableDinObject (struct DinObject *);
  108. *    D0                     A0
  109.  
  110.         GLUEDEF DisableDinObject
  111.         move.l  4(a7),a0
  112.         CALLDIN
  113.         rts
  114.  
  115. *    BOOL PropagateDinObject (struct DinObject *, struct Task *);
  116. *    D0                       A0                  A1
  117.  
  118.         GLUEDEF PropagateDinObject
  119.         movem.l 4(a7),a0-a1
  120.         CALLDIN
  121.         rts
  122.  
  123. *    BOOL RemoveDinObject (struct DinObject *);
  124. *    D0                    A0
  125.  
  126.         GLUEDEF RemoveDinObject
  127.         move.l  4(a7),a0
  128.         CALLDIN
  129.         rts
  130.  
  131. *    BOOL LockDinObject (struct DinObject *);
  132. *    D0                  A0
  133.  
  134.         GLUEDEF LockDinObject
  135.         move.l  4(a7),a0
  136.         CALLDIN
  137.         rts
  138.  
  139. *    BOOL UnlockDinObject (struct DinObject *);
  140. *    D0                    A0
  141.  
  142.         GLUEDEF UnlockDinObject
  143.         move.l  4(a7),a0
  144.         CALLDIN
  145.         rts
  146.  
  147. *    struct DinObject *FindDinObject (char *);
  148. *    D0                               A0
  149.  
  150.         GLUEDEF FindDinObject
  151.         move.l  4(a7),a0
  152.         CALLDIN
  153.         rts
  154.  
  155. *    struct DinLink *MakeDinLink (struct DinObject *, char *);
  156. *    D0                           A0                  A1
  157.  
  158.         GLUEDEF MakeDinLink
  159.         movem.l 4(a7),a0-a1
  160.         CALLDIN
  161.         rts
  162.  
  163. *    void RemoveDinLink (struct DinLink *);
  164. *                        A0
  165.  
  166.         GLUEDEF RemoveDinLink
  167.         move.l  4(a7),a0
  168.         CALLDIN
  169.         rts
  170.  
  171. *    BOOL ReadLockDinObject (struct DinObject *);
  172. *    D0                      A0
  173.  
  174.         GLUEDEF ReadLockDinObject
  175.         move.l  4(a7),a0
  176.         CALLDIN
  177.         rts
  178.  
  179. *    void ReadUnlockDinObject (struct DinObject *);
  180. *                              A0
  181.  
  182.         GLUEDEF ReadUnlockDinObject
  183.         move.l  4(a7),a0
  184.         CALLDIN
  185.         rts
  186.  
  187. *    BOOL WriteLockDinObject (struct DinObject *);
  188. *    D0                       A0
  189.  
  190.         GLUEDEF WriteLockDinObject
  191.         move.l  4(a7),a0
  192.         CALLDIN
  193.         rts
  194.  
  195. *    void WriteUnlockDinObject (struct DinObject *);
  196. *                               A0
  197.  
  198.         GLUEDEF WriteUnlockDinObject
  199.         move.l  4(a7),a0
  200.         CALLDIN
  201.         rts
  202.  
  203. *    void LockDinBase (void);
  204. *
  205.  
  206.         GLUEDEF LockDinBase
  207.         CALLDIN
  208.         rts
  209.  
  210. *    void UnlockDinBase (void);
  211. *
  212.  
  213.         GLUEDEF UnlockDinBase
  214.         CALLDIN
  215.         rts
  216.  
  217. *    struct InfoDinObject *InfoDinObject (struct DinObject *);
  218. *    D0                                   A0
  219.  
  220.         GLUEDEF InfoDinObject
  221.         move.l  4(a7),a0
  222.         CALLDIN
  223.         rts
  224.  
  225. *    void FreeInfoDinObject (struct InfoDinObject *);
  226. *                            A0
  227.  
  228.         GLUEDEF FreeInfoDinObject
  229.         move.l  4(a7),a0
  230.         CALLDIN
  231.         rts
  232.  
  233.         END
  234.