home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / NOVEL_C.ZIP / NETWORK.ASM next >
Encoding:
Assembly Source File  |  1988-10-18  |  7.8 KB  |  502 lines

  1. Page 58,132
  2. ;*******************************************************
  3. ;*..LAST UPDATE-DATE : 08/11/85 ......TIME : 11:45:12..*
  4. ;*                               *
  5. ;* VERSION: 1.2                        *
  6. ;*                               *
  7. ;* MODULE NAME: NETWORK.ASM    Language Interface     *
  8. ;*                               *
  9. ;* DESCRIPTION:  Netware interface drivers           *
  10. ;*                               *
  11. ;*      ****    Data Light C Interface  ****           *
  12. ;*                               *
  13. ;* INPUTS:  Refer to individual procedures.           *
  14. ;*                               *
  15. ;*                               *
  16. ;* RETURNS (OUTPUTS)  Refer to individual procedures.  *
  17. ;*                               *
  18. ;*******************************************************
  19.  
  20.     include macros.asm
  21.  
  22.     begcode    network
  23.  
  24. ;--------------------------------
  25. ; Logout System  func(215) (D7H)
  26. ;
  27. ;    sysout();
  28. ;
  29.     public    sysout
  30.  
  31. func    sysout
  32.     mov    ah,0D7H
  33.     callm    arg0
  34. sysout    endp
  35.  
  36.  
  37. ;--------------------------------
  38. ; WorkStation ID func(220) (DCH)
  39. ;    returns hex number only
  40. ;    int    ws_no;
  41. ;
  42. ;    ws_no = wsid();
  43. ;
  44.     public    wsid
  45.  
  46. func    wsid
  47.     mov    ah,0DCH
  48.     int    21h
  49.     mov    ah,0
  50.     ret
  51. wsid    endp
  52.  
  53.  
  54.  
  55. ;--------------------------------
  56. ; Attach to File Server func(F1h)
  57. ;    returns 0 on completion
  58. ;
  59. ;    attach(entry);
  60. ;    int entry;
  61. ;
  62.     public    attach
  63.  
  64. func    attach
  65.     push    bp
  66.     mov    bp,sp
  67.     mov    dx,P[bp]
  68.     mov    al,00h
  69.     mov    ah,0F1h
  70.     int    21h
  71.     mov    ah,0
  72.     pop    bp
  73.     ret
  74. attach    endp
  75.  
  76.  
  77. ;--------------------------------
  78. ; Attach to File Server func(F1h)
  79. ;    returns 0 on completion
  80. ;
  81. ;    detach(entry);
  82. ;    int entry;
  83. ;
  84.     public    detach
  85.  
  86. func    detach
  87.     push    bp
  88.     mov    bp,sp
  89.     mov    dx,P[bp]
  90.     mov    al,01h
  91.     mov    ah,0F1h
  92.     int    21h
  93.     mov    ah,0
  94.     pop    bp
  95.     ret
  96. detach    endp
  97.  
  98.  
  99. ;--------------------------------
  100. ; Attach to File Server func(F1h)
  101. ;    returns 0 on completion
  102. ;
  103. ;    logout(entry);
  104. ;    int entry;
  105. ;
  106.     public    logout
  107.  
  108. func    logout
  109.     push    bp
  110.     mov    bp,sp
  111.     mov    dx,P[bp]
  112.     mov    al,02h
  113.     mov    ah,0F1h
  114.     int    21h
  115.     mov    ah,0
  116.     pop    bp
  117.     ret
  118. logout    endp
  119.  
  120.  
  121. ;--------------------------------
  122. ; Set Error mode func(221) (DDH)
  123. ;
  124. ;    int    mode;
  125. ;
  126. ;    Err_Mode(mode);
  127. ;
  128.     public    Err_Mode
  129.  
  130. func    err_mode
  131.     mov    ah,0DDH
  132.     callm    arg1
  133. err_mode endp
  134.  
  135.  
  136. ;--------------------------------
  137. ; Brodcast Mode func(222) (DEH)
  138. ;
  139. ;    int    mode;
  140. ;
  141. ;    bcs_mode(mode);
  142. ;
  143.     public    bcs_mode
  144.  
  145. func    bcs_mode
  146.     mov    ah,0DEH
  147.     callm    arg1
  148. bcs_mode endp
  149.  
  150.  
  151. ;--------------------------------
  152. ; Modify LST Device  func(223) (DFH)
  153. ;
  154. ;    int    mode;
  155. ;
  156. ;    ctlspl(mode);
  157. ;
  158.     public    ctlspl
  159.  
  160.  
  161. func    ctlspl
  162.     mov    ah,0DFh
  163.     callm    arg1
  164. ctlspl    endp
  165.  
  166.  
  167. ;--------------------------------
  168. ; Spool Request func(224) (E0H)
  169. ;
  170. ;    char    reqblk[],retblk[];
  171. ;
  172. ;    splreq(reqblk,reply);
  173. ;
  174.     public    splreq
  175.  
  176. func    splreq
  177.     mov    ah,0E0h
  178.     push    bp
  179.     mov    bp,sp
  180.     push    ds
  181.     pop    es
  182.     mov    si,P[bp]
  183.     mov    di,P+2[bp]
  184.     int    21h
  185.     mov    ah,0
  186.     pop    bp
  187.     ret
  188. splreq    endp
  189.  
  190. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  191. ;
  192. ; GET SHELL TABLE ADDRESSES         EF
  193. ;
  194. ; int TableReq, *TableSeg, *TableOff;
  195. ;
  196. ; GetSta(TableReq,TableSeg,TableOff);
  197. ;
  198.     public    getsta
  199.  
  200. func    getsta
  201.     push    bp
  202.     mov    bp,sp
  203.     .push    <es>
  204.     mov    ax,P[bp]        ;AL = Shell Status
  205.     mov    ah,0EFh            ;Table Request Code
  206.     int    21h
  207.  
  208.     mov    bx,P+2[bp]
  209.     mov    [bx],es         ;store Shell Status Table Seg
  210.     mov    bx,P+4[bp]
  211.     mov    [bx],si            ;store Shell Status Table Off
  212.     .pop    <es>
  213.     pop    bp
  214.     ret
  215.  
  216. getsta    endp
  217.  
  218. ;--------------------------------
  219. ; Login system func(227) (E3H)
  220. ;
  221. ;    int ret_code
  222. ;    char reqblk[],retblk[];
  223. ;
  224. ; ret_code = syslog(reqblk,reply);
  225. ;
  226.     public    syslog
  227.  
  228.  
  229. func    syslog
  230.     push    bp
  231.     mov    bp,sp
  232.     push    ds
  233.     pop    es
  234.     mov    si,P[bp]
  235.     mov    di,P+2[bp]
  236.     mov    ah,0E3h
  237.     int    21h
  238.     mov    ah,0
  239.     pop    bp
  240.     ret
  241. syslog    endp
  242.  
  243. ;--------------------------------
  244. ; Network Communications func(225) (E1H)
  245. ;
  246. ;    int ret_code
  247. ;    char reqblk[],retblk[];
  248. ;
  249. ; ret_code = net_comm(reqblk,reply);
  250. ;
  251.     public    net_comm
  252.  
  253.  
  254. func    net_comm
  255.     push    bp
  256.     mov    bp,sp
  257.     push    ds
  258.     pop    es
  259.     mov    si,P[bp]
  260.     mov    di,P+2[bp]
  261.     mov    ah,0E1h
  262.     int    21h
  263.     mov    ah,0
  264.     pop    bp
  265.     ret
  266. net_comm    endp
  267.  
  268. ;--------------------------------
  269. ; get time / date string func(231) (E7H)
  270. ;
  271. ; char    tod_date; /* Y M D H M S Weekday */
  272. ;
  273. ; tod_date = net_tod(&time);
  274. ;
  275.     public    net_tod
  276.  
  277. func    net_tod
  278.     mov    ah,0E7h
  279.     push    bp         ; save the base pointer
  280.     mov    bp,sp         ; bp gets the sp address
  281.     mov    dx,P[bp]     ; dx gets the ptr
  282.     int    21h         ; dos call
  283.     mov    ah,0         ; clear ah for al return
  284.     pop    bp
  285.     ret
  286. net_tod endp
  287.  
  288. ;--------------------------------
  289. ; Shell Base Status func(233) (E9H)
  290. ;
  291. ;    int    drive;
  292. ;
  293. ;    map = drv_map(drive);
  294. ;
  295.     public    drv_map
  296.  
  297. func    drv_map
  298.     push    bp         ; save the base pointer
  299.     mov    bp,sp         ; bp gets the sp address
  300.     mov    dx,P[bp]     ; dx gets arg. (or ptr)
  301.     mov    ax,0E900h
  302.     int    21h         ; dos call
  303.     pop    bp
  304.     ret             ; ret & reset stack
  305. drv_map endp
  306.  
  307.  
  308.  
  309. ;--------------------------------
  310. ; Return Shell Version func(234) (EAH)
  311. ;
  312. ;    int    retshl, mode
  313. ;
  314. ;    ret_code = ret_shl(mode);
  315. ;
  316.     public    ret_shl
  317.  
  318. func    ret_shl
  319.     push    bp         ; save the base pointer
  320.     mov    bp,sp         ; bp gets the sp address
  321.     mov    ax,P[bp]
  322.     mov    ah,0EAh
  323.     int    21h         ; dos call
  324.     mov    ah,0         ; clear ah for al return
  325.     pop    bp
  326.     ret             ; return and reset stack
  327. ret_shl endp
  328.  
  329.  
  330.  
  331. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  332. ;
  333. ; Get Physical Station Number  EEH
  334. ;
  335. ; Get_PSN();
  336. ;
  337.     public    Get_PSN
  338.  
  339. func    get_psn
  340.     mov    ah,0C3h
  341.     int    21h
  342.     mov    ah,0
  343.     ret
  344.  
  345. get_psn endp
  346.  
  347.  
  348. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  349. ;
  350. ; SET PREFERRED FILE SERVER        F0H
  351. ;
  352. ;
  353. ;      int SelectedFS,PreferredFS,SelCode;
  354. ;
  355. ; SelectedFS = SetServ(SelCode,PreferredFS);
  356. ;
  357. ;
  358.     public    SetServ
  359.  
  360. func    setserv
  361.     push    bp
  362.     mov    bp,sp
  363.     mov    ax,P[bp]        ;AL = Mode
  364.     mov    dx,P+2[bp]        ;DL = FS
  365.  
  366.     mov    ah,0F0h
  367.     int    21h
  368.     mov    ah,0
  369.     pop    bp
  370.     ret
  371. setserv endp
  372.  
  373. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  374. ;
  375. ; ATTACH/DETACH TO FILE SERVER         F0H
  376. ;
  377. ;
  378. ; int CompCode,PreferredFS,SelCode;
  379. ;
  380. ; CompCode = ModServ(SelCode,PreferredFS);
  381. ;
  382. ;
  383.     public    ModServ
  384.  
  385. func    modserv
  386.     push    bp
  387.     mov    bp,sp
  388.     mov    ax,P[bp]        ;AL = Mode
  389.     mov    dx,P+2[bp]        ;DL = FS
  390.  
  391.     mov    ah,0F0h
  392.     int    21h
  393.     mov    ah,0
  394.     pop    bp
  395.     ret
  396. modserv endp
  397.  
  398. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  399. ;
  400. ; NETWORK FILE COPY        F3H
  401. ;
  402. ;
  403. ; int source,dest;
  404. ; long s_offset,d_offset;
  405. ; long number;
  406. ;
  407. ; ret = ncopy(source,dest,s_offset,d_offset,number);
  408. ;
  409. ; ret = number of bytes copied
  410. ;
  411.     public    ncopy
  412.  
  413. func    ncopy
  414.     push    bp
  415.     mov    bp,sp
  416.     mov    di,bp
  417.     add    di,04h            ;ES:DI = Address of request string
  418.  
  419.     mov    ah,0F3h
  420.     int    21h
  421.     
  422.     tst    al            ;If al != 0 error occurred
  423.     jne    ncopy1
  424.     mov    ax,cx
  425.     mov    dx,dx
  426.     pop    bp
  427.     ret
  428. ncopy1:    mov    ax,-1            ;Indicate an error
  429.     mov    bx,ax
  430.     pop    bp
  431.     ret
  432.  
  433. ncopy    endp
  434.  
  435. ;--------------------------------
  436. ; Directory Request func(226) (E2H)
  437. ;
  438. ;    int ret_code
  439. ;    char reqblk[],retblk[];
  440. ;
  441. ; ret_code = dir_req(reqblk,reply);
  442. ;
  443.     public    dir_req
  444.  
  445.  
  446. func    dir_req
  447.     push    bp
  448.     mov    bp,sp
  449.     push    ds
  450.     pop    es
  451.     mov    si,P[bp]
  452.     mov    di,P+2[bp]
  453.     mov    ah,0E2h
  454.     int    21h
  455.     mov    ah,0
  456.     pop    bp
  457.     ret
  458. dir_req    endp
  459.  
  460. ;---------------------------------------
  461. ; process but expect no arguments
  462. ;
  463. func    arg0
  464.     int    21h
  465.     mov    ah,0
  466.     ret
  467. arg0    endp
  468.  
  469.  
  470. ;--------------------------------
  471. ; Process a single argument in a
  472. ; function call....
  473.  
  474. func    arg1
  475.     push    bp         ; save the base pointer
  476.     mov    bp,sp         ; bp gets the sp address
  477.     mov    dx,P[bp]     ; dx gets the arg (or ptr)
  478.     int    21h         ; dos call
  479.     mov    ah,0         ; clear ah for al return
  480.     pop    bp
  481.     ret             ; return and reset stack
  482. arg1    endp
  483.  
  484. ;--------------------------------
  485. ; Process a single double sized argument in a
  486. ; function call if using the large data model
  487.  
  488. func    arg2
  489.     push    bp         ; save the base pointer
  490.     mov    bp,sp         ; bp gets the sp address
  491.     mov    dx,P[bp]     ; dx gets the arg (or ptr)
  492.     int    21h         ; dos call
  493.     mov    ah,0         ; clear ah for al return
  494.     pop    bp
  495.     ret
  496. arg2    endp
  497.  
  498.     endcode    network
  499.  
  500.     end
  501.  
  502.