home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / xdme1820.lha / XDME / AREXX / rexxbind.a next >
Text File  |  1993-01-27  |  4KB  |  212 lines

  1. ; === rexxbind.asm =====================================================
  2. ;
  3. ; Copyright (c) 1986, 1987 by William S. Hawes (All Rights Reserved)
  4. ;
  5. ; ======================================================================
  6. ; "Glue" routines for calling functions in the ARexx Systems Library.
  7. ; All calls assume that the external _RexxSysBase has been set to the
  8. ; ARexx SYstems library base by a call to OpenLibrary.
  9.  
  10. ; some addes by b_null
  11.  
  12.     section text,CODE
  13.  
  14.         XREF     _RexxSysBase
  15.  
  16. _LVODeleteArgstring    equ    -$84
  17. _LVOLengthArgstring    equ    -$8A ;bn
  18. _LVOCreateRexxMsg    equ    -$90
  19. _LVODeleteRexxMsg    equ    -$96
  20. _LVOClearRexxMsg    equ    -$9C ;bn
  21. _LVOFillRexxMsg     equ    -$A2 ;bn
  22. _LVOFreePort        equ    -$EA
  23. _LVOInitPort        equ    -$E4
  24. _LVOIsRexxMsg        equ    -$A8
  25. _LVOCreateArgstring    equ    -$7E
  26. _LVOClearMem        equ    -$D8
  27. _LVOFindRsrcNode    equ    -$B4
  28. _LVOInitList        equ    -$DE
  29. _LVOLockBase        equ    -450 ;d0
  30. _LVOUnlockBase        equ    -456 ;d0
  31. _LVOAddClipNode     equ    -438 ;a0/1 d0/1
  32. _LVORemClipNode     equ    -444 ;a0
  33.  
  34.  
  35. ; First calling convention:
  36. ; 1, 2, or 3 parameters in (A0,A1,D0), return value in D0.
  37.  
  38.      ; msgptr = CreateRexxMsg(&replyport,&fileext,&hostname)
  39.  
  40.      XDEF      _CreateRexxMsg
  41. _CreateRexxMsg:
  42.      move.w   #_LVOCreateRexxMsg,d2
  43.      bra      CallSeqA01D0
  44.  
  45.  
  46.      ; DeleteArgstring(argptr)
  47.  
  48.      XDEF      _DeleteArgstring
  49. _DeleteArgstring:
  50.      move.w   #_LVODeleteArgstring,d2
  51.      bra      CallSeqA01D0
  52.  
  53.  
  54.      ; DeleteRexxMsg(msgptr)
  55.  
  56.      XDEF      _DeleteRexxMsg
  57. _DeleteRexxMsg:
  58.      move.w   #_LVODeleteRexxMsg,d2
  59.      bra      CallSeqA01D0
  60.  
  61.  
  62.      ; FreePort(&msgport)
  63.  
  64.      XDEF      _FreePort
  65. _FreePort:
  66.      move.w   #_LVOFreePort,d2
  67.      bra      CallSeqA01D0
  68.  
  69.  
  70.      ; signal = InitPort(&replyport)
  71.  
  72.      XDEF      _InitPort
  73. _InitPort:
  74.      move.w   #_LVOInitPort,d2
  75.      bra      CallSeqA01D0
  76.  
  77.  
  78.      ; boolean = IsRexxMsg(msgptr)
  79.  
  80.      XDEF      _IsRexxMsg
  81. _IsRexxMsg:
  82.      move.w   #_LVOIsRexxMsg,d2
  83.      bra      CallSeqA01D0
  84.  
  85.  
  86.      ; long = FindRsrcNode(strptr,long)
  87.  
  88.      XDEF      _FindRsrcNode
  89. _FindRsrcNode:
  90.      move.w   #_LVOFindRsrcNode,d2
  91.      bra      CallSeqA01D0
  92.  
  93.  
  94.     ;LengthArgstring(argstring)(a0)
  95.  
  96.      XDEF      _LengthArgstring
  97. _LengthArgstring
  98.      move.w   #_LVOLengthArgstring,d2
  99.      bra      CallSeqA0
  100.  
  101.  
  102.     ;ClearRexxMsg(msgptr,count)(a0,d0)
  103.  
  104.      XDEF      _ClearRexxMsg
  105. _ClearRexxMsg
  106.      move.w   #_LVOClearRexxMsg,d2
  107.      bra      CallSeqA0D0
  108.  
  109.  
  110.     ;FillRexxMsg(msgptr,count,mask)(a0,d0/d1)
  111.  
  112.      XDEF      _FillRexxMsg
  113. _FillRexxMsg
  114.      move.w   #_LVOFillRexxMsg,d2
  115.      bra      CallSeqA0D01
  116.  
  117.  
  118.      XDEF      _InitList
  119. _InitList:
  120.      move.w   #_LVOInitList,d2
  121.      bra      CallSeqA0
  122.  
  123.      XDEF      _LockBase
  124. _LockBase:
  125.      move.w   #_LVOLockBase,d2
  126.      bra      CallSeqD0
  127.  
  128.      XDEF      _UnlockBase
  129. _UnlockBase:
  130.      move.w   #_LVOUnlockBase,d2
  131.      bra      CallSeqD0
  132.  
  133.      XDEF      _AddClipNode
  134. _AddClipNode:
  135.      move.w   #_LVOAddClipNode,d2
  136.      bra      CallSeqA01D01
  137.  
  138.      XDEF      _RemClipNode
  139. _RemClipNode:
  140.      move.w   #_LVORemClipNode,d2
  141.      bra      CallSeqA0
  142.  
  143.  
  144. ; Second calling convention:  2 parameters in (A0,D0), return value in D0.
  145.  
  146.      ; argptr = CreateArgstring(&string,length)
  147.  
  148.      XDEF      _CreateArgstring
  149. _CreateArgstring:
  150.      moveq      #_LVOCreateArgstring,d2
  151.      bra      CallSeqA0D0
  152.  
  153.      ; ClearMem(address,length)
  154.  
  155.      XDEF      _ClearMem
  156. _ClearMem:
  157.      move.w   #_LVOClearMem,d2
  158.      bra      CallSeqA0D0
  159.  
  160.  
  161.      ; Load 1 Argument into (A0)
  162.      nop        ;fix lattice assembler bug
  163. CallSeqA0 movea.l  4(sp),a0
  164.      bra      CallFunc
  165.  
  166.      ; Load 1 Argument into (D0)
  167.      nop        ;fix lattice assembler bug
  168. CallSeqD0 move.l  4(sp),d0
  169.      bra      CallFunc
  170.  
  171.      ; Load two arguments into (A0,D0)
  172.      nop    ;fix lattice assembler bug
  173. CallSeqA0D0 movea.l  4(sp),a0
  174.      move.l   8(sp),d0
  175.      bra      CallFunc
  176.  
  177.      ; Load four arguments into (A0,A1,D0,D1)
  178.      nop        ;fix lattice assembler bug
  179. CallSeqA01D01 movea.l  4(sp),a0
  180.      movea.l  8(sp),a1
  181.      move.l   12(sp),d0
  182.      move.l   16(sp),d1
  183.      bra      CallFunc
  184.  
  185.      ; Load three arguments into (A0,D0,D1)
  186.      nop        ;fix lattice assembler bug
  187. CallSeqA0D01 movea.l  4(sp),a0
  188.      move.l   8(sp),d0
  189.      move.l   12(sp),d1
  190.      bra      CallFunc
  191.  
  192.      ; Load three arguments into (A0,A1,D0)
  193.      nop        ;fix lattice assembler bug
  194. CallSeqA01D0 movea.l  4(sp),a0
  195.      movea.l  8(sp),a1
  196.      move.l   12(sp),d0
  197.  
  198.  
  199.      ; Call the library function
  200. CallFunc move.l   a6,-(sp)
  201.      movea.l  _RexxSysBase(A4),a6
  202.      jsr      0(a6,d2.w)
  203.      movea.l  (sp)+,a6
  204.      rts
  205.  
  206.      END
  207.  
  208.  
  209.  
  210.  
  211.  
  212.