Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site houxt.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!hogpc!houxt!ijk From: ijk@houxt.UUCP Newsgroups: net.micro.pc Subject: LOW LEVEL I/O PROBLEM - FIRST READ IS GARBAGE, NEXT ARE ONE BEHIND. Message-ID: <407@houxt.UUCP> Date: Sun, 20-May-84 09:22:04 EDT Article-I.D.: houxt.407 Posted: Sun May 20 09:22:04 1984 Date-Received: Tue, 22-May-84 07:13:38 EDT Organization: ATT Information Systems, Holmdel NJ Lines: 33 I've been playing around with interfacing with the ROM BIOS and DOS function calls. (I'm using standard assembler to do the low-level work, with interfaces provided to 'C", per standard conventions). When I try to interface to the Async device, I run into a weird problem when I put my modem into analog loopback: ----------------------------------------- /* the code looks like this */ int i,inp; for (i=0; i<= 255; i++) { writecom(i); /* send out char over port */ inp = readcom(); /* read char back in */ if ( i != inp) printf("i = %x, inp = %x\n"); } /* writecom and readcom can either be DOS func 3 & 4 or * calls to the ROM BIOS; no difference */ ------------------------------------------- The first char read is ALWAYS GARBAGE - from then on, I'm one char BEHIND (i.e., when i = 1, inp = 0, etc.). It would appear at first glance that a 1 char buffer is somehow inserted into the system, but if I do a read first, I just hang, waiting for a char. What's going on???? If anyones interested, I'll send them actual assembler code as well. Thanx in advance. Ihor Kinal houti!ijk