[comp.sys.ibm.pc] Switchar setting in MS-DOS

pechter@scr1.UUCP (Bill Pechter) (05/27/89)

I'm going through the MS-DOS Encyclopedia by Ray Duncan -- but I can't
find any reference to the system call to change the switch character...

Anyone have the code and registers needed to write a small assembler
program to change the switchar from "/" to "-".

I did it  years ago but can't find the reference materials.

Bill
-- 
Bill Pechter -- Home - 103 Governors Road, Lakewood, NJ 08701 (201)370-0709
Work -- Concurrent Computer Corp., 2 Crescent Pl, MS 172, Oceanport,NJ 07757 
Phone -- (201)870-4780    Usenet  . . .  rutgers!pedsga!tsdiag!scr1!pechter
  **   MS-DOS is CP/M on steroids, bigger bulkier and not much better  ** 

mju@mudos.ann-arbor.mi.us (Marc Unangst) (06/01/89)

In article <340@scr1.UUCP>, pechter@scr1.UUCP (Bill Pechter) writes:
 >I'm going through the MS-DOS Encyclopedia by Ray Duncan -- but I can't
 >find any reference to the system call to change the switch character...
 >
 >Anyone have the code and registers needed to write a small assembler
 >program to change the switchar from "/" to "-".

/* For Turbo C v1.0+ -- This will *not* work under MSC!!! */
#include <dos.h>        /* For setswitchar() and getswitchar() */
#include <process.h>    /* For exit() */
#include <stdio.h>      /* For printf() */

void main(int, char **);

main(int argc, char **argv)
{
        char schar;
        if(argc != 2) {
                printf("switch: usage: switch switch-char\n");
                exit(1);
        }
        schar = (char *) argv[1];
        setswitchar(schar);
        printf("switch: switch character set to %c\n", getswitchar());
        exit(0);
}

--  
Marc Unangst
UUCP smart    : mju@mudos.ann-arbor.mi.us
UUCP dumb     : ...!uunet!sharkey!mudos!mju
UUCP dumb alt.: ...!{ames,rutgers}!mailrus!clip!mudos!mju
Internet      : mju@mudos.ann-arbor.mi.us

mju@mudos.ann-arbor.mi.us (Marc Unangst) (06/01/89)

In article <460.24844889@mudos.ann-arbor.mi.us>, I write:
 >/* For Turbo C v1.0+ -- This will *not* work under MSC!!! */
 >#include <dos.h>        /* For setswitchar() and getswitchar() */
 >#include <process.h>    /* For exit() */
 >#include <stdio.h>      /* For printf() */
 >
 >void main(int, char **);
 >
 >main(int argc, char **argv)
[program deleted]

Oops!  The above line should be changed to read

void main(int argc, char **argv)

If you compile it the way it was, you will get a "error in function
redefinition" message (or something like that).

--  
Marc Unangst
UUCP smart    : mju@mudos.ann-arbor.mi.us
UUCP dumb     : ...!uunet!sharkey!mudos!mju
UUCP dumb alt.: ...!{ames,rutgers}!mailrus!clip!mudos!mju
Internet      : mju@mudos.ann-arbor.mi.us