Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!caip!princeton!allegra!mit-eddie!genrad!decvax!decwrl!pyramid!hplabs!tektronix!tekcrl!tekgvs!toma From: toma@tekgvs.UUCP Newsgroups: net.micro.pc,net.lang.forth Subject: Yet another switch.com Message-ID: <1603@tekgvs.UUCP> Date: Thu, 3-Jul-86 14:01:09 EDT Article-I.D.: tekgvs.1603 Posted: Thu Jul 3 14:01:09 1986 Date-Received: Sat, 5-Jul-86 05:42:14 EDT Reply-To: toma@tekgvs.UUCP (Thomas Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 76 Xref: linus net.micro.pc:8560 net.lang.forth:408 The recently posted switch.com (a program to change the switch character) failed to run on my system (boy is this a common problem!). The C program source compiled fine, but produced a rediculously large, 6000 byte, executable file considering this is a tiny program. So here is another version, both in source (Forth for my Cforth compiler) and as a 319 byte COM file: \ DOS utility which changes the switch character \ execute "SWITCH" to see the current value, \ or "SWITCH c" to set the character to "c". 100 MSDOS \ This line, the "IN/OUT" lines, and the last two \ lines are compiler directives HEX 80 CONSTANT COMMAND-LINE \ Address of command line buffer 2 1 IN/OUT CODE DOSINT ( DL-value AX-value -- DL-value ) BL DL MOV \ set up registers, AX is already OK! 21 INT DL AL MOV \ return result AH AH XOR RET 0 1 IN/OUT : GET-IT ( -- character ) 0 3700 DOSINT ; 2 0 IN/OUT : CHANGE-IT ( oldChar newChar -- ) ." Changing option switch character from " SWAP EMIT ." to " DUP EMIT CR 3701 DOSINT DROP ; 1 0 IN/OUT : DISPLAY-IT ( currentChar -- ) ." Current switch character is " EMIT CR ; 0 0 IN/OUT : QUIT ( go back to DOS in an expedient manner ) 0 0 BDOS ; : MAIN GET-IT COMMAND-LINE COUNT 0 ?DO \ look for argument character COUNT DUP BL <> IF NIP CHANGE-IT QUIT ELSE DROP THEN LOOP DROP \ unneeded address pointer DISPLAY-IT ; INCLUDE FORTHLIB END ---------Cut Here and uudecode------------ begin 644 switch.com MZ0@`/P(`````"@"\FO_'!@4!F/^]_O^)+@