home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / nxcopy / intr.i86 < prev    next >
Text File  |  1987-06-22  |  3KB  |  83 lines

  1.         name    Novell_Interface_Routine
  2.  
  3.         assume  cs:code
  4.  
  5. data    segment public
  6. data    ends
  7.  
  8. code    segment public
  9.  
  10.         public  swapl
  11.         public  intr
  12.  
  13. swapl   proc    near
  14. ; this routine converts a Pascal LongInt (low-high) to a Novell Long (high-low),
  15. ; or vice versa.
  16.         pop     dx
  17.         pop     ax
  18.         pop     bx
  19.         xchg    bh,al
  20.         xchg    bl,ah
  21.         jmp     dx
  22. swapl   endp
  23.  
  24. intr    proc    near
  25. ; this routine provides the interface between Pascal and the Novell function
  26. ; calls. note that this routine will not convert words and longs to and from
  27. ; PC native format and Novell format; this chore must be handled by the appli-
  28. ; cation.
  29.         push    bp                      ; save caller's frame pointer
  30.         mov     bp,sp
  31.         push    bp                      ; save my frame pointer
  32.         push    ds                      ; save caller's ds...
  33.         push    es                      ;               es...
  34.         pushf                           ;               flags
  35.         mov     al,byte ptr[bp+8]       ; prepare self-modifying code trick
  36.         mov     cs:byte ptr inter,al    ; caller gives us interrupt number
  37.         mov     ds,word ptr[bp+6]       ; address the Pascal record
  38.         mov     si,word ptr[bp+4]
  39.         mov     ax,word ptr[si+14]
  40.         push    ax                      ; push ds
  41.         mov     ax,word ptr[si+8]
  42.         push    ax                      ; push si
  43.         mov     ax,word ptr[si]         ; load ax
  44.         mov     bx,word ptr[si+2]       ; load bx
  45.         mov     cx,word ptr[si+4]       ; load cx
  46.         mov     dx,word ptr[si+6]       ; load dx
  47.         mov     di,word ptr[si+10]      ; load di
  48.         mov     bp,word ptr[si+12]      ; load bp
  49.         mov     es,word ptr[si+16]      ; load es
  50.         pop     si                      ; load si
  51.         pop     ds                      ; load ds
  52.         db      0cdh                    ; inline code for an interrupt
  53. inter   db      21h
  54.         pushf
  55.         push    ds
  56.         push    si
  57.         push    bp
  58.         mov     bp,sp                   ; get my frame pointer back
  59.         add     bp,14
  60.         mov     bp,word ptr[bp]         ; address the Pascal record again
  61.         mov     ds,word ptr[bp+6]
  62.         mov     si,word ptr[bp+4]
  63.         mov     word ptr[si],ax         ; store ax
  64.         mov     word ptr[si+2],bx       ; store bx
  65.         mov     word ptr[si+4],cx       ; store cx
  66.         mov     word ptr[si+6],dx       ; store dx
  67.         mov     word ptr[si+10],di      ; store di
  68.         mov     word ptr[si+16],es      ; store es
  69.         pop     word ptr[si+12]         ; store bp
  70.         pop     word ptr[si+8]          ; store si
  71.         pop     word ptr[si+14]         ; store ds
  72.         pop     word ptr[si+18]         ; store flags
  73.         popf
  74.         pop     es
  75.         pop     ds
  76.         pop     bp
  77.         pop     bp
  78.         ret     4
  79. intr    endp
  80.  
  81. code    ends
  82.         end
  83.