home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff284.lzh / Dme / src / rexxbind.asm < prev    next >
Assembly Source File  |  1989-11-27  |  2KB  |  113 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.     section text,CODE
  11.  
  12.      INCLUDE  "rexx/storage.i"
  13.      INCLUDE  "rexx/rxslib.i"
  14.  
  15.      XREF      _RexxSysBase
  16.  
  17. * First calling convention:
  18. * 1, 2, or 3 parameters in (A0,A1,D0), return value in D0.
  19.  
  20.      ; msgptr = CreateRexxMsg(&replyport,&fileext,&hostname)
  21.  
  22.      XDEF      _CreateRexxMsg
  23. _CreateRexxMsg:
  24.      move.w   #_LVOCreateRexxMsg,d1
  25.      bra.s      CallSeq1
  26.  
  27.  
  28.      ; DeleteArgstring(argptr)
  29.  
  30.      XDEF      _DeleteArgstring
  31. _DeleteArgstring:
  32.      move.w   #_LVODeleteArgstring,d1
  33.      bra.s      CallSeq1
  34.  
  35.  
  36.      ; DeleteRexxMsg(msgptr)
  37.  
  38.      XDEF      _DeleteRexxMsg
  39. _DeleteRexxMsg:
  40.      move.w   #_LVODeleteRexxMsg,d1
  41.      bra.s      CallSeq1
  42.  
  43.  
  44.      ; FreePort(&msgport)
  45.  
  46.      XDEF      _FreePort
  47. _FreePort:
  48.      move.w   #_LVOFreePort,d1
  49.      bra.s      CallSeq1
  50.  
  51.  
  52.      ; signal = InitPort(&replyport)
  53.  
  54.      XDEF      _InitPort
  55. _InitPort:
  56.      move.w   #_LVOInitPort,d1
  57.      bra.s      CallSeq1
  58.  
  59.  
  60.      ; boolean = IsRexxMsg(msgptr)
  61.  
  62.      XDEF      _IsRexxMsg
  63. _IsRexxMsg:
  64.      move.w   #_LVOIsRexxMsg,d1
  65.      bra.s      CallSeq1
  66.  
  67.      ; Load three arguments into (A0,A1,D0)
  68.  
  69.      nop        ;fix lattice assembler bug
  70.  
  71. CallSeq1 movea.l  4(sp),a0
  72.      movea.l  8(sp),a1
  73.      move.l   12(sp),d0
  74.  
  75.  
  76.      ; Call the library function
  77.  
  78. CallFunc move.l   a6,-(sp)
  79.      movea.l  _RexxSysBase(A4),a6
  80.      jsr      0(a6,d1.w)
  81.      movea.l  (sp)+,a6
  82.      rts
  83.  
  84.  
  85. * Second calling convention:  2 parameters in (A0,D0), return value in D0.
  86.  
  87.      ; argptr = CreateArgstring(&string,length)
  88.  
  89.      XDEF      _CreateArgstring
  90. _CreateArgstring:
  91.      moveq      #_LVOCreateArgstring,d1
  92.      bra.s      CallSeq2
  93.  
  94.  
  95.      ; ClearMem(address,length)
  96.  
  97.      XDEF      _ClearMem
  98. _ClearMem:
  99.      move.w   #_LVOClearMem,d1
  100.      bra.s      CallSeq2
  101.  
  102.  
  103.      ; Load two arguments (A0,D0)
  104.  
  105.      nop    ;fix lattice assembler bug
  106.  
  107. CallSeq2 movea.l  4(sp),a0
  108.      move.l   8(sp),d0
  109.      bra      CallFunc
  110.  
  111.      END
  112.  
  113.