I/O Port Access in Microsoft Visual C++
11:13 AM // 0 comments // Sajib Barua // Category: Interfacing //Microsoft Visual C/C++ provides access to the I/O ports on the 80x86 CPU via the predefined functions _inp / _inpw and _outp / _outpw.
int _inp(unsigned portid); /* returns a byte read from the I/O port portid */
unsigned _inpw(unsigned portid); /* returns a word read from the I/O port portid */
int _outp(unsigned portid, /* writes the byte value to the I/O port portid */
int value); /* returns the data actually written */
unsigned _outpw(unsigned portid, /* writes the word value to the I/O port portid */
unsigned value); /* returns the data actually written */
portid can be any unsigned integer in the range 0-65535
#include /* required only for function declarations */
#define Data 0x378
#define Status 0x379
#define Control 0x37a
int Bits, /* 0 <= Bits <= 255 */
Dummy;
Dummy = _outp(Data,Bits); /* output data */

Related posts :
0 comments for this post
Leave a reply
Microsoft Word LaTeX Shortcut...
05-Nov-2020Learn Python...
23-Mar-2019A Mathematical Theory of Comm...
10-Dec-2015The Free Energy Secrets of Co...
26-Dec-2014Electronic refrigeration usin...
23-Nov-2014
- Radhika says:
Nice. Thanks for the great information. I have read many blogs but this blog is really informative....[[More detail]] - arohi patil says:
Two Stage Transformer Oil Filtration Plant - Jhun05 says:
Hi, i really needineed help,isais there anyone who can help me about this kV2c FM45s GE electric...[[More detail]] - arif says:
You possess lifted an essential offspring..Blesss for using..I would want to study better latest...[[More detail]] - Dilip says:
Very informative blog. thank you for sharing . keep posting.[[More detail]]