Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!grkermi!panda!talcott!harvard!stew From: stew@harvard.ARPA Newsgroups: net.micro.mac Subject: Re: serial port I/O Message-ID: <189@harvard.ARPA> Date: Thu, 13-Jun-85 01:01:43 EDT Article-I.D.: harvard.189 Posted: Thu Jun 13 01:01:43 1985 Date-Received: Sat, 15-Jun-85 06:42:55 EDT References: <2238@mordor.UUCP> Distribution: net Organization: Aiken Computation Laboratory, Harvard Lines: 29 > I've been trying to put together an application which will use the > modem port to talk to a standard RS-232C device (modem or VAX). > I was able to get it to work, but I've run across a couple of > unexpected software problems. I am using the Megamax C compiler. > > My first problem is that a number of the routines (OpenDriver, > SerSetBuf, SerReset) are returning a positive "error code". I > interpreted *IM* to say that a successful driver call will return > 0 and an unsuccessful one will return a negative error code. The > functions I call appear to work, so I now ignore the error code > unless it is negative. (Before I had this code debugged I would > occasionally see a negative error code, and they were always > meaningful.) Does the positive number have any meaning? > > John Bruner (S-1 Project, Lawrence Livermore National Laboratory) > MILNET: jdb@mordor.ARPA [jdb@s1-c] (415) 422-0758 > UUCP: ...!ucbvax!dual!mordor!jdb ...!decvax!decwrl!mordor!jdb The MegaMax PBOpen routine returns the wrong value. It throws away the ROM trap's result and instead returns the value in the ioResult field. I have fixed, but I don't think I can post source code for MegaMax's library. I suggest you disassemble and look at file6.o, and then recode it yourself (it's only a few lines of asm). This will hopefully be fixed in a new version of MegaMax C rumored to be out this month. -- ----------------------- Stew Rubenstein UUCP: ihnp4!harvard!stew Harvard Chemistry ARPA: stew@harvard