Category : Word Processors
Archive   : HP22D5.ZIP
Filename : ISSUBST.ASM

Output of file : ISSUBST.ASM contained in archive : HP22D5.ZIP

EXTRN ReturnValue:FAR

DIRSTRUCTSZ_DOS3 equ 51h ;works for DOS 3.X
DIRSTRUCTSZ_DOS4 equ 58h ;works for DOS 5.0 too!



pname db 'issubst',0

Pool PoolStruct
PoolStruct <> ;END


dtable dd 0
lastdrv db 0

public WhenLoaded
mov ah,52h
int 21h ;ES:BX = pointer to DOS info

mov al,es:[bx+21h] ;AL = last drive
mov cs:lastdrv,al ;save

les bx,es:[bx+16h] ;ES:BX = drive table pointer
mov word ptr cs:dtable + 2,es ;save
mov word ptr cs:dtable,bx

mov ah,30h
int 21h ;AL = version high
cmp al,4 ;change size if > 3.X
jb WL1
mov cs:tablesz,DIRSTRUCTSZ_DOS4

; This routine returns TRUE if a given drive letter is a subst drive, or
; FALSE otherwise.
; To call this routine from HyperPAD:
; if issubst("F") then beep;
issubst: push bp
mov bp,sp

mov ax,[bp+6] ;AX = NumArgs
cmp ax,1
jne _FALSE

mov ah,30h ;dos version number
int 21h
cmp al,3 ;not a subst drive if DOS < 3

les bx,[bp+8] ;ES:BX = hDrive
les bx,es:[bx] ;ES:BX = pDrive
mov al,es:[bx] ;AL = drive letter
cmp al,'a' ;convert to upper case
jb IS3
cmp al,'z'
ja IS3
sub al,32
sub ax,'A' ;AX: A = 0, B = 1, etc
cmp al,cs:lastdrv ;greater than last drive?
jae _FALSE ;not a subst drive (network?)

cbw ;AX = drive letter
mov bl,cs:tablesz
mul bl ;AX = driveletter * tablesz
les bx,cs:dtable ;ES:BX = drive table
add bx,ax ;ES:BX = drive table entry for that drive

mov ax,es:[bx+43h] ;AX = drive flags
and ax,1000h
jz IS2

mov ax,1 ;AX = TRUE (is a subst drive)

push ax ;convert to boolean
call btoh
push dx ;pass to HyperPAD
push ax
call ReturnValue

mov ax,STOP ;don't pass message on
pop bp

_FALSE: xor ax,ax ;return FALSE (not a subst drive)
jmp short IS2


  3 Responses to “Category : Word Processors
Archive   : HP22D5.ZIP
Filename : ISSUBST.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: