//------------------------------------------------------- // 32bit Flat model I/O port service for BC++ // 1997/2 Mathematical Assist Design Lab. Hal.T //------------------------------------------------------- #ifdef __WIN32__ extern "C" { //---------------------------------- void cli(void) { asm cli; } //---------------------------------- void sti(void) { asm sti; } //---------------------------------- void outportb(int portid, int value) { asm { mov dx, word ptr portid mov ax, word ptr value out dx, al }; } //---------------------------------- unsigned int inportb(int portid) { unsigned short int rd; asm { mov dx, word ptr portid in al, dx mov rd, ax }; return rd; } //---------------------------------- }; #endif // __WIN32__ //-----------------------------------