Subj : finding the ramdrive To : All From : Jasen Betts Date : Sat Mar 02 2002 09:38 am Hi All. ms-dos comes with a prog called findramd.exe but it's a pig and only works with their ramdrive. here's an alternative that's probably easier to use too. This is probably not the final version. but I don't want to make it much bigger. ; nasm source for a ms-dos *.com program "gotoramd.com" org 100h mainloop: call checkdrive jnc found mov dl,[disknum] inc dl mov [disknum],dl cmp dl,20h ; 32 is the most disks allowed jnz mainloop mov bx,2 ; "not found" message to stderr mov ah,40h ; so it doesn't redirect mov cx,nomsglen mov dx,noramdisk int 21h int 20h ; not found: return errorlevel 0 found: mov dl,[disknum] ; change disk dec dl mov ah,0eh int 21h mov al,[disknum] add [diskletter],al ; say drive letter mov ah,9 mov dx,diskfound int 21h mov ah,4ch ; return errorlevel a=1 b=2 c=3 etc. int 21h checkdrive: mov bl,[disknum] ; mov ax,4408h ; is it removable? int 21h ; jc .notramdisk cmp ax,01 jnz .notramdisk mov ax,4409h ; is it local, directly available and non-subst mov bl,[disknum] int 21h jc .notramdisk test dx,9020h jnz .notramdisk push ds mov dl,[disknum] ; how many FATs does it have mov ah,32h int 21h mov ah,[bx+08] pop ds cmp ax,0100h ; 1 is the correct answer jnz .notramdisk clc ret ..notramdisk: stc ret disknum: db 1 noramdisk: db "ramdisk not found",13,10 nomsglen equ $-noramdisk diskfound: db "set ramdisk=" diskletter: db "@:",13,10,36 -=> Bye <=- --- * Origin: Sattinger's Law: It works better if you plug it in. (3:640/531.42) .