home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / BBS_UTIL / BM0406_A.ZIP / BMASM.ZIP / BASNOV.ASM < prev    next >
Assembly Source File  |  1992-08-02  |  3KB  |  106 lines

  1. ;---------------
  2. ; ██████████████████████████████████████████████
  3. ; █████████████ BASNOV 0.01 ████████████████████
  4. ; ██████████████████████████████████████████████
  5. ; █████████████ ASSEMBLE WITH MASM 5.1 █████████
  6. ; ██████████████████████████████████████████████
  7. ;---------------
  8. ;
  9. ; Changes made by Scott McNay (1:395/11) July 26, 1992, to allow routine to be
  10. ; used with code compiled with BC's /Fs option.  (Most) changes marked with
  11. ; ;BCFS0726.  May have optimized some code also.  This is a plug-in replacement
  12. ; for the original code.
  13.  
  14. ;BCFS0801: Standardized code format.  Made sure that DI, SI, BP, and DS are
  15. ;  saved to meet requirements of BC 7.x.
  16.  
  17.     Extrn    StringAddress:far                          ;BCFS0726
  18.  
  19.         .model    medium,basic
  20. ;---------------
  21.         .code
  22.  
  23. Filename    db    128 dup (0)        ; buffer for Filename
  24.  
  25. ;---------------
  26. ; CheckNovell(Err%)
  27. ;
  28. ; return values for Err% :
  29. ;
  30. ;     0    if Netware installed
  31. ;    -1    if Netware not installed
  32. ;
  33. CheckNovell    proc    Err:word
  34.  
  35.         mov    ax,0B600h        ; get station number
  36.         int    21h
  37.         or    al,al            ; Netware loaded ?
  38.         jz    Error
  39.  
  40.         xor    ax,ax            ; return  0 if no error
  41.         jmp    short Exit
  42.  
  43. Error:        mov    ax,-1            ; return -1 if error
  44.  
  45. Exit:        mov    bx,[Err]        ; set result to Err%
  46.         mov    [bx],ax
  47.         ret
  48.  
  49. CheckNovell    endp
  50. ;---------------
  51. ;  SetSharedAttr(Filename$, Err%)
  52. ;
  53. ;  return values for Err% :
  54. ;
  55. ;     0    no error reported by DOS
  56. ;    -1    error reported by DOS
  57. ;
  58. SetSharedAttr    proc    Filenam:ptr, Err:word
  59. INT    3    ;For debugging.  Remove when operation verified              ;BCFS0726
  60.         push    ds                              ;BCFS0726
  61.         push    es                              ;BCFS0801
  62.         push    di                              ;BCFS0801
  63.         push    si                              ;BCFS0801
  64.         push    [Filenam]                          ;BCFS0726
  65.         call    StringAddress                          ;BCFS0726
  66.         mov    si,ax            ; address of string          ;BCFS0726
  67.         mov    ds,dx            ; segment of string          ;BCFS0726
  68.  
  69.         mov    ax,cs            ; ES:DI points to local buffer;BCFS0801
  70.         mov    es,ax
  71.         mov    di,offset Filename
  72.         mov    dx,di            ; copy offset into DX
  73.         rep    movsb            ; copy string contents
  74.         xor    al,al            ; make string ASCIIZ          ;BCFS0801
  75.         stosb
  76.  
  77.         mov    ax,cs            ; make DS equal to CS          ;BCFS0801
  78.         mov    ds,ax
  79.  
  80.         mov    ax,04300h        ; CHMOD, get attribute
  81.         int    21h
  82.         jc    Error            ; check for error
  83.  
  84.         or    cl,80h            ; set shared bit
  85.  
  86.         mov    ax,04301h        ; CHMOD, set attribute
  87.         int    21h
  88.         jc    Error            ; check for error
  89.  
  90.         xor    ax,ax            ; set Err% to  0
  91.         jmp    short Exit
  92.  
  93. Error:        mov    ax,-1            ; set Err% to -1
  94.  
  95. Exit:        pop    si
  96.         pop    di
  97.         pop    es            ; restore ES
  98.         pop    ds            ; restore DS
  99.         mov    bx,[Err]        ; offset of Err%
  100.         mov    [bx],ax         ; store result
  101.         ret                ; return
  102.  
  103. SetSharedAttr    endp
  104. ;---------------
  105.         end
  106.