void outportb(unsigned short int port,unsigned char value)
{
//move dx,*(&port);
__emit__(0x8b,0x95,&port);
//mov al,*(&value);
__emit__(0x8a,0x85,&value);
//out dx,al;
__emit__(0x66,0xee);
}
void outportw(unsigned short int port,unsigned short int value)
{
//move dx,*(&port);
__emit__(0x8b,0x95,&port);
//mov ax,*(&value);
__emit__(0x66,0x8b,0x85,&value);
//out dx,ax;
__emit__(0xef);
}
unsigned char inportb(unsigned short int port)
{
unsigned char value;
//move dx,*(&port);
__emit__(0x8b,0x95,&port);
//in al,dx;
__emit__(0x66,0xec);
//mov *(&value),al;
__emit__(0x88,0x85,&value);
return value;
}
unsigned short int inportw(unsigned short int port)
{
unsigned short int value;
//move dx,*(&port);
__emit__(0x8b,0x95,&port);
//in ax,dx
__emit__(0xed);
//mov *(&value),ax
__emit__(0x66,0x89,0x85,&value);
return value;
}




