home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / n / netbioc.zip / NETBIOS.ASM < prev    next >
Assembly Source File  |  1992-03-01  |  1KB  |  52 lines

  1.       TITLE netbios.asm
  2.  
  3.  
  4. extrn NETBIOSCALL : far
  5.  
  6.  
  7.        ASSUME CS:_TEXT
  8.  
  9. _TEXT SEGMENT WORD PUBLIC 'CODE'
  10.  
  11.  
  12. ;****************************************************************************
  13. ;    FUNCTION: unsigned int far pascal NetBios( char far *NCB)
  14. ;
  15. ;    PURPOSE:  Submits a NCB thru Windows NetBIOSCall
  16. ;
  17. ;    COMMENTS:
  18. ;
  19. ;               Returns immediate return code (NCB.RetCode)
  20. ;
  21. ;*****************************************************************************/
  22.  
  23.  
  24.         PUBLIC NETBIOS
  25.  
  26.  
  27. NETBIOS PROC FAR
  28.          push    bp                     ; save  bp
  29.          mov     bp, sp                 ; move sp into bp to allow stack access
  30.          push    es                     ; save es
  31.          push    bx                     ; save bx
  32.  
  33.          mov     es, WORD PTR [bp+8]    ; put HIWORD() into es
  34.          mov     bx, WORD PTR [bp+6]    ; put LOWORD() into bx
  35.  
  36.          call    NetBiosCall            ; call Windows NetBios API
  37.  
  38.          xor     ah, ah
  39.          mov     al, BYTE PTR es:[bx+1] ; return the NCB return code
  40.  
  41.          pop     bx                     ; restore bx
  42.          pop     es                     ; restore es
  43.          mov     sp, bp                 ; restore sp
  44.          pop     bp                     ; restore bp
  45.          ret     4                      ; return to caller, and fixup stack
  46.  
  47. NETBIOS ENDP
  48.  
  49. _TEXT    ENDS
  50.  
  51. END
  52.