home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / Vector18.lha / ParNetExample / tag.asm < prev    next >
Encoding:
Assembly Source File  |  1993-12-18  |  2.7 KB  |  143 lines

  1. ;/*
  2. ; * This code was originally written by Matthew Dillon and put into Public Domain
  3. ; *
  4. ; * All changes concerning the adaption of Matt's original code to the
  5. ; * Vector Connection I/O board are © 1991-1993 by Henning Schmiedehausen
  6. ; * All rights for this changes are reserved. The original code is Public Domain
  7. ; *
  8. ; * This code is distributed with the expressed written permission of Matthew
  9. ; * Dillon (Thank you very much, Matt)
  10. ; *
  11. ; */
  12.  
  13.         ;   TAG.ASM
  14.         ;
  15.         ;   Tag for PARNET.DEVICE   (Parallel Port Network)
  16.         ;
  17.         ;   Provides unit vectoring of commands and C layering.
  18.  
  19.         include "exec/types.i"
  20.         include "exec/exec.i"
  21.         include "exec/resident.i"
  22.         include "parnet.device.i"
  23.  
  24.         section text,code
  25.  
  26.         xref    _LVORemTask
  27.  
  28.         xref    _CDevInit    ; C routines for assembly tags
  29.         xref    _CDevOpen
  30.         xref    _CDevClose
  31.         xref    _CDevExpunge
  32.         xref    _LinkerDB    ; Lattice C linker A4 base (ea)
  33.  
  34.         xref    _CParNetTask
  35.  
  36.         xref    _UnitControlOpen
  37.         xref    _UnitDGramOpen
  38.         xref    _UnitStreamOpen
  39.  
  40.         xdef    _ParNetTask
  41.  
  42.         moveq.l #0,D0
  43.         rts
  44.  
  45. InitDesc:
  46.         dc.w    RTC_MATCHWORD
  47.         dc.l    InitDesc
  48.         dc.l    EndCode
  49.         dc.b    0        ;   not auto-init
  50.         dc.b    VERSION    ;   version
  51.         dc.b    NT_DEVICE
  52.         dc.b    0        ;   priority
  53.         dc.l    _DeviceName
  54.         dc.l    _IdString
  55.         dc.l    _DevInit
  56.         dc.l    0        ;   extra ?
  57.         dc.l    0
  58.         dc.l    0
  59.  
  60.  
  61.         section __MERGED,DATA
  62.  
  63.         xdef    _DeviceName    ; tag strings
  64.         xdef    _IdString
  65.         xdef    _DeviceVectors    ; device vectors
  66.         xdef    _UnitVectors
  67.  
  68. _DeviceName:    dc.b    'parnet.device',0
  69. _IdString:    VSTRING
  70.  
  71.         ds.l    0
  72.  
  73. _DeviceVectors:
  74.         dc.l    _DevOpen
  75.         dc.l    _DevClose
  76.         dc.l    _DevExpunge
  77.         dc.l    0
  78.         dc.l    _DevBeginIO
  79.         dc.l    _DevAbortIO
  80.         dc.l    -1
  81.  
  82. _UnitVectors:
  83.         dc.l    _UnitControlOpen
  84.         dc.l    _UnitDGramOpen
  85.         dc.l    _UnitStreamOpen
  86.  
  87. EndCode:
  88.         section text,code
  89.  
  90. _DevInit:    movem.l A0/A4,-(sp)         ;   A0=segment
  91.         lea    _LinkerDB,A4        ;    Lattice C
  92.         jsr    _CDevInit
  93.         movem.l (sp)+,A0/A4
  94.         rts
  95.  
  96. _DevOpen:    movem.l D0/D1/A1/A4,-(sp)   ;   D0=unit, D1=flags, A1=iob
  97.         lea    _LinkerDB,A4
  98.         jsr    _CDevOpen
  99.         addq.l    #4,sp
  100.         movem.l (sp)+,D1/A1/A4
  101.         rts
  102.  
  103. _DevClose:    movem.l A1/A4,-(sp)         ;   A1=iob
  104.         lea    _LinkerDB,A4
  105.         jsr    _CDevClose
  106.         movem.l (sp)+,A1/A4
  107.         rts
  108.  
  109. _DevExpunge:    move.l    A4,-(sp)            ;
  110.         lea    _LinkerDB,A4
  111.         jsr    _CDevExpunge
  112.         move.l    (sp)+,A4
  113.         rts
  114.  
  115. _DevBeginIO:    movem.l A1/A4,-(sp)         ; A1=iob
  116.         move.l    IO_UNIT(A1),A0      ; vector through unit
  117.         move.l    LN_SIZE(A0),A0      ; (see defs.h/Unit)
  118.         lea    _LinkerDB,A4
  119.         jsr    (A0)
  120.         movem.l (sp)+,A1/A4
  121.         rts
  122.  
  123. _DevAbortIO:    movem.l A1/A4,-(sp)         ; A1=iob
  124.         move.l    IO_UNIT(A1),A0      ; vector through unit
  125.         move.l    LN_SIZE+4(A0),A0    ; (see defs.h/Unit)
  126.         lea    _LinkerDB,A4
  127.         jsr    (A0)
  128.         movem.l (sp)+,A1/A4
  129.         rts
  130.  
  131. _ParNetTask:
  132.         lea    _LinkerDB,A4
  133.         jsr    _CParNetTask
  134.         move.l    4,A6
  135.         sub.l    A1,A1
  136.         jsr    _LVORemTask(A6)
  137. rt        jmp    rt
  138.  
  139.  
  140.  
  141.         END
  142.  
  143.