home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 278.lha / RegexLibrary_v1.0 / alink.asm < prev    next >
Assembly Source File  |  1989-08-06  |  2KB  |  83 lines

  1. ;  Glue code between assembler and C for the GNU regular expression library. Edwin Hoogerbeets 18/07/89
  2. ;
  3. ;  This file may be copied and distributed under the GNU Public
  4. ;  Licence. See the comment at the top of regex.c for details.
  5. ;
  6. ;  Adapted from Elib by Jim Mackraz, mklib by Edwin Hoogerbeets, and the
  7. ;  GNU regular expression package by the Free Software Foundation.
  8.  
  9.         include 'exec/types.i'
  10.  
  11. ; external references
  12.         public _re_BSD_initialize
  13.         public _re_BSD_terminate
  14.         public _re_comp
  15.         public _re_exec
  16.  
  17.  
  18. ; external definitions
  19.         public re_BSD_initialize
  20.         public re_BSD_terminate
  21.         public re_comp
  22.         public re_exec
  23.  
  24.         public _geta4
  25.  
  26. setup   macro
  27.         movem.l d2/d3/d4-d7/a2-a6,-(sp)
  28.         jsr     _geta4
  29.         endm
  30.  
  31. push    macro
  32.         move.l  \1,-(sp)
  33.         endm
  34.  
  35. fix     macro
  36.         ifc     '\1',''
  37.                 mexit
  38.         endc
  39.         ifle    \1-8
  40.                 addq.l  #\1,sp
  41.         endc
  42.         ifgt    \1-8
  43.                 lea     \1(sp),sp
  44.         endc
  45.         endm
  46.  
  47. restore macro
  48.         fix     \1
  49.         movem.l (sp)+,d2/d3/d4-d7/a2-a6
  50.         rts
  51.         endm
  52.  
  53.         cseg
  54.  
  55. ;
  56. ; These four routines are written in C, so the arguments, if any, must
  57. ; be put on the stack
  58. ;
  59. re_BSD_initialize:
  60.         jmp _re_BSD_initialize
  61.  
  62. re_BSD_terminate:
  63.         jmp _re_BSD_terminate
  64.  
  65. re_comp:
  66.         setup
  67.         push d0
  68.         jsr _re_comp
  69.         restore 4
  70.  
  71. re_exec:
  72.         setup
  73.         push d0
  74.         jsr _re_exec
  75.         restore 4
  76.  
  77.         end
  78.  
  79.  
  80.  
  81.  
  82.  
  83.