Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!harpo!floyd!clyde!akgua!sb1!mb2c!jed From: jed@mb2c.UUCP (John E. Duncan III) Newsgroups: net.sources Subject: pwd for APPLE AZTEC 'C' system Message-ID: <182@mb2c.UUCP> Date: Mon, 7-Nov-83 13:17:24 EST Article-I.D.: mb2c.182 Posted: Mon Nov 7 13:17:24 1983 Date-Received: Tue, 8-Nov-83 15:20:41 EST Lines: 29 /* pwd.c * Print the working directory of AZTEC C on the APPLE * stdout device. It should be easy, but since there is no * system call to do it, we open an absurdly named file for * read and then go peeking around in DOS to see what drive * the system tried to read it on. */ #define DRIVE 0xB7F8 #define SLOT 0xB7F7 #define VOL 0xB7F6 char mesg[] = "sX, dX, vXXX\n"; main() { register char ch; open( "", 0 ); ch = *SLOT; mesg[1] = (ch>>4) + '0'; ch = *DRIVE; mesg[5] = ch + '0'; ch = *VOL; mesg[11] = ch%10 + '0'; ch = ch/10; mesg[10] = ch%10 + '0'; mesg[9] = ch/10 + '0'; write( 1, mesg, 13 ); }