delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/15/10:14:51

Date: Wed, 15 Oct 1997 16:06:29 +0200 (CEST)
From: =?ISO-8859-2?Q?Przemys=B3aw_Fr=B1k?= <pasterz AT dagobah DOT autocont DOT com DOT pl>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: =?ISO-8859-2?Q?Dag_H=E5kon_Myrdal?= <daghakmy AT login DOT eunet DOT no>,
djgpp AT delorie DOT com
Subject: Re: Using inportb()
In-Reply-To: <Pine.SUN.3.91.971015131204.17868I-100000@is>
Message-ID: <Pine.BSF.3.96.971015160610.6897B-100000@dagobah.autocont.com.pl>
MIME-Version: 1.0

SPIERDALAC !!!!!!!!!!!!!!!!!!!!!!!!!!!!
MOZE CHAMSTWO COS POMOZE !!!!


            _________________________________________
	    |  Przemysław Paweł Fr±k <pasterz>      |
            |  Internet Manager	                    |
	    |  AutoCont Sp. z o.o.                  |
            |  ul.Mikołajska 11 31-027 Kraków       |
            |  tel/fax.(012)413-25-60/422-37-97     |
            |  http://www.autocont.com.pl/          |
            |  e-mail:pasterz AT autocont DOT com DOT pl       |
	    -----------------------------------------

On Wed, 15 Oct 1997, Eli Zaretskii wrote:

> 
> On 14 Oct 1997, Dag Hĺkon Myrdal wrote:
> 
> > #include <pc.h>
> > [...]
> > 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.
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019