home *** CD-ROM | disk | FTP | other *** search
- ;
- ; NextDriv -- Sets the DOS variable ERRORLEVEL to the number of the next
- ; Novell network drive available for map allocation.
- ;
- ; Assembled with Borland Turbo Assembler v1.00
- ;
- ; T.Yamada of Unocal O & G, Ventura, 5Apr89
- ;
- ORG 100h ;Starting location for .COM file
- .MODEL TINY ;Everything fits in a single segment
- .CODE
- push bp ;Save frame pointer
- mov bp,sp ;Reset FP to our curr SP
- push si ;Save SI
- Begin:
- mov cx,27 ;Init loopdown counter, allow Z+1 for none
- xor dx,dx ;Start with drive A: (drive number 0)
- Iterate:
- mov ax,0E900h ;DOS "Get DirHandle" function call
- int 21h ;Do it!
- or ah,ah ;An available drive or Z+1 will yield 0 here.
- jz Done ;IF ah=0, we're through
- inc dx ;Otherwise, get ready for the next drive
- loop Iterate ;And try, try again... 'til CX = 0
- Done:
- pop si ;Restore SI
- pop bp ;Restore FP
- mov al,dl ;Set ERRORLEVEL value to DL count
- mov ah,4Ch ;DOS "Exit" function
- int 21h ;Do it! A revoir!
- END Begin