From: galt@hellgate.utah.edu (Greg Alt)
Subject: Re: Power Glove
Date: Mon, 20 May 91 22:00:30 -0600
Organization: University of Utah, CS Dept., Salt Lake City


> [Moderator(Mark): I have requested the author's source code-- 
>  I will post it as soon as I receive it.]

ok, here it is:

#include <dos.h>
main()
{
int b,x;
while(1)
  {
  outportb(0x378,1);
  outportb(0x378,3);
  outportb(0x378,1);
  for(b=x=0;x<8;x++)
    {
    b=b<<1;
    b+=(inportb(0x379)&16)>>4;
    outportb(0x378,0);
    outportb(0x378,1);
    }
  b^=255;
  gotoxy(1,1);
  printf("%d%d%d%d%d%d%d%d\n",(b&128)>>7,(b&64)>>6,(b&32)>>5,
         (b&16)>>4,(b&8)>>3,(b&4)>>2,(b&2)>>1,b&1);
  }
}


It's exactly the same as the assembly code shown in the BYTE
article, but I figured it would be much simpler to do it in 
C.  The final value from the glove is in b at the end of the 
loop.  You can change this to a simple function like:
 
char powerglove()
{
. 
[Moderator(Mark): Is this the end, or a mailer glitch?]


