Return-Path: <roe@rapfast.Unibase.SK.CA>
Received: from sprite.Berkeley.EDU (allspice.berkeley.edu) by cdrom.com (4.1/SMI-4.1)
	id AA01644; Fri, 19 Mar 93 00:55:36 PST
Received: from rapfast.Unibase.SK.CA by sprite.Berkeley.EDU (5.59/1.29)
	id AA659017; Fri, 19 Mar 93 00:54:26 PST
Received: by rapfast.Unibase.SK.CA
  (5.65c/IDA-1.4.4 for rab@allspice.Berkeley.EDU)
  id AA04432; Fri, 19 Mar 1993 02:52:27 -0600
Message-Id: <199303190852.AA04432@rapfast.Unibase.SK.CA>
Subject: Attach #1 of 1 </u2/src/msdos/fake/mscfake.asm>
To: rab@sprite.Berkeley.EDU (Robert A. Bruce)
Date: Fri, 19 Mar 93 2:52:27 CST
From: Roe Peterson <roe@rapfast.Unibase.SK.CA>
In-Reply-To: <9303190645.AA999201@sprite.Berkeley.EDU>; from "Robert A. Bruce" at Mar 18, 93 10:45 pm
Attachment: 1 of 1 </u2/src/msdos/fake/mscfake.asm>
X-Mailer: ELM [version 2.3XA PL11]

This code is made available to the public with this caveat:  this is _NOT_
up to my normal production code standards, and I don't want to hear
about problems.  It works for me, and does what we need it to do.
I _would_ like to hear about improvements, but I'm so busy trying to
get SASS 2.0 out that I have no time to perfect MSCFAKE.


---- Cut Here and unpack ----
#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
#	Run the following text with /bin/sh to create:
#	  mscfake.asm
#
echo "x - extracting mscfake.asm (Text)"
sed 's/^X//' << 'SHAR_EOF' > mscfake.asm &&
X;
X; mscfake.asm - a small 2fh int TSR that fakes _some_ of the mscdex
X;		installation checks.  PLEASE READ THE COMMENTS in the
X;		code before using.
X;
X;		This code is HARDWIRED to present drive G: as the
X;		CD.  Search for DRIVE to find locations of relevance.
X;
X;		I'm using tasm for this;  I have no idea what masm will
X;		do with it.
X;
X; to make it:
X;	tasm mscfake
X;	tlink mscfake
X;	exe2com mscfake
X;	del mscfake.exe
X
Xcode		segment word public
X		assume	cs:code
X		org 100h
X
Xstart:
X		jmp start1
X
X		even
X;
X; lastcall records the last unknown call to mscfake.  This can be useful
X; if something seems not to be working;  use debug to look at it.
X;
Xlastcall	dw	0fefeh
Xmynum		equ	15h		; mscdex calls are all 2f func 15
Xint_2f_next	dd	?		; link addr for int 2f.
Xbadload		db 'MSCFAKE already loaded.',0dh,0ah,'$'
Xgoodload	db 'MSCFAKE installed.',0dh,0ah,'$'
X
Xint_2f:
X	cmp	ah,mynum	; msc call?
X	je	mine		; yes
X	cmp	ax,1100h	; installation check?
X	je	is11		; yes
X	jmp	int_2f_next	; not for us - punt to link addr
X
Xis11:
X	mov cs:lastcall,ax	; func 1100 not implemented - just save it
X	jmp int_2f_next		; punt to link addr
X
Xmine:
X	cmp al,0f8h		; func ID must be < f8
X	jb do_func
X
X	iret
X
Xdo_func:
X	or al,al		; func. 1500 installation check?
X	jne non_install		; no
X	mov al,0ffh		; yes - signal we are installed
X	mov bx,1		; one cdrom drive
X	mov cx,7		; DRIVE LETTER IS G:
X	iret
X
Xnon_install:
X	cmp al,66h		; func. 1566 - for debugging
X	jne notident
X	mov ax,cs:lastcall	; seems never to happen
X	iret
X
Xnotident:
X	cmp al,0ch		; func 150c - get version ID?
X	jne notgetver		; no
X	mov bh,2		; ver 2.02
X	mov bl,2
X	iret
X
Xnotgetver:
X	cmp al,0dh		; func 150d - get CD drive letters?
X	jne notletters		; no
X	mov di,bx
X	mov al,7		; DRIVER LETTER IS G:
X	stosb
X	iret
X
Xnotletters:
X	mov cs:lastcall,ax	; failure.
X	mov al,0h
X	iret
X
Xendcode		dd	?
X
X
Xstart1:
X	mov ax,cs
X	mov ds,ax
X
X	mov ah,mynum		; are we already installed?
X	xor al,al
X	int 2fh
X	or al,al
X	jz ok_install		; no
X
X	mov ah,9		; yes - error message and bail
X	mov dx, offset badload
X	int 21h
X
X	mov ah,4ch
X	int 21h
X
Xok_install:
X	mov ah,9
X	mov dx,offset goodload
X	int 21h
X
X	mov al,2fh		; install the 2f TSR
X	mov ah, 35h
X	int 21h
X	mov word ptr int_2f_next+2,es
X	mov word ptr int_2f_next, bx
X	mov dx,offset int_2f
X	mov al,2fh
X	mov ah,25h
X	int 21h
X
X	mov dx,offset endcode
X
X	add	dx,0fh		;round up to next highest paragraph.
X	mov	cl,4
X	shr	dx,cl
X	mov	ah,31h		;terminate, stay resident.
X	mov	al,0		; errorlevel (0 - 9, just diagnostics)
X	int	21h
Xcode	ends
X	end start
X
X
SHAR_EOF
chmod 0700 mscfake.asm || echo "restore of mscfake.asm fails"
exit 0
