RE: Windows question

From: jeff hendrix <jhendrix_at_Quark.Com>
Date: Thu Jul 22 1999 - 13:15:49 EDT

Thanks for the assembly suggestion. I think I figured it out.

my function was actually
        if (INPUT(p)== VERSION) { blah blah }

with INPUT(p) being defined as _inp(p)

I couldn't get it to work until I put in the line
        test = INPUT(p);
which I then was able to see that I needed to mask out the 3 lower bits.

So I changed
#define INPUT(p) _inp(p)
to
#define INPUT(p) _inp(p)&0xf8

which now I can see introduced a precedence problem (0xf8 != VERSION)

the moral of the story is "double check your macros"

-jeff

-----Original Message-----
From: Kurt Mahan [mailto:kmahan@xmission.com]
Sent: Thursday, July 22, 1999 10:50 AM
To: vectorlist@lists.cc.utexas.edu
Subject: Re: Windows question

> I'm trying to read in the status port and compare it against a value, but
> it's showing some strange behavior.
>
> This doesn't work-
>
> if (_inp(statusreg) == VERSION) { blah blah }
>
> but this does-
>
> test = _inp(statusreg);
> if (test == VERSION) { blah blah }

When you generate an assembly listing of the code what does it look like?

Kurt
Received on Thu Jul 22 12:17:25 1999

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2003 - 00:31:28 EDT