Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!floyd!clyde!akgua!sb1!mb2c!jed From: jed@mb2c.UUCP (John E. Duncan III) Newsgroups: net.sources Subject: APPLE 'C' pwd command Message-ID: <176@mb2c.UUCP> Date: Sun, 6-Nov-83 15:39:28 EST Article-I.D.: mb2c.176 Posted: Sun Nov 6 15:39:28 1983 Date-Received: Tue, 8-Nov-83 03:51:27 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 ); }