Date: Wed, 15 Oct 1997 13:12:32 +0200 (IST) From: Eli Zaretskii To: Dag Håkon Myrdal cc: djgpp AT delorie DOT com Subject: Re: Using inportb() In-Reply-To: <61vc83$565$1@elle.eunet.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8bit Precedence: bulk On 14 Oct 1997, Dag Håkon Myrdal wrote: > #include > [...] > outportb(0x22C); /* write to SW trigger */ > inportb(0x225); /* read ADC value and status */ > > What happens is that the compiled program seems not to get in > contact with the labcard. The status never changed when used as below. You use `outportb' incorrectly: it requires a second argument--the value being written to the port. The way you used it, it writes some random value (whatever it finds on the stack), which will certainly not work. You should use the -Wall compilation switch to cause GCC emit diagnostics for such cases. I don't know why the emx version doesn't have two arguments. It should know somhow what value to write to that port. > To me, the only obvious difference here is that I no longer > explitly ask for access to the IO bus - is this not necessary with > djgpp? No, at least as long as you use it under MS-DOS.