🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #14706

Re: switchar

#14706
From: Ed Nather
Date: Tue, 09 Dec 1986 15:01
38 lines
1977 bytes
In article <2690001@hplsla.HP.COM>, davidr@hplsla.HP.COM (      David Reed) writes:
> SWITCHAR  is  indeed  used  to  modify  DOS so as to be  able  to use  another
> character instead of the backslash as directory separator, [...]
> The program  works on my computer with MSDOS
> 2.11, but will not work with the  computer  I have  running  MSDOS  3.1, and I
> suspected  (without doing any checking) that the  undocumeted  function was no
> longer available.

You should have checked.  A call to Dos function 37 returns the current
value of SWITCHAR  (with AX == 0) and the same function call can be used to 
change it (with AX == 1).  It works on DOS 2.x and 3.x, all versions.  

Here is a very short assembly language program that sets SWITCHAR to "\" so
the "/" can be used as a path separator.  The modified DOS works with all
programs EXCEPT MICROSOFT'S LIB utility routine, which insists "\" is the
only legitimate path separator.

-------------------------------------------------------------------------

cseg    segment para public 'code'
        assume cs:cseg,ds:cseg,es:cseg,ss:cseg

org     100h

ent     proc near
        MOV DL,'\'      ; DL was slash, change it to backslash
        MOV AX,3701h    ; AH=CharOper, AL=Set it
        INT 21h         ; DOS Command
        RET
ent     endp
cseg    ends
        end ent

-- 
Ed Nather
Astronomy Dept, U of Texas @ Austin
{allegra,ihnp4}!{noao,ut-sally}!utastro!nather
nather@astro.AS.UTEXAS.EDU
Technical Details
Message-ID: <6528@ut-sally.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!nather
References: <1402@uw-june>> <2690001@hplsla.HP.COM>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!nather
From: nather@ut-sally.UUCP (Ed Nather)
Newsgroups: comp.sys.ibm.pc
Subject: Re: switchar
Message-ID: <6528@ut-sally.UUCP>
Date: Tue, 9-Dec-86 10:01:00 EST
Article-I.D.: ut-sally.6528
Posted: Tue Dec  9 10:01:00 1986
Date-Received: Wed, 10-Dec-86 03:24:52 EST
References: <1402@uw-june>> <2690001@hplsla.HP.COM>
Organization: U. Texas CS Dept., Austin, Texas
Lines: 38