FreeBASIC  0.91.0
sys_portio.c
Go to the documentation of this file.
1 /* ports I/O functions */
2 
3 #include "../fb.h"
4 #include "fb_private_console.h"
5 
6 int fb_hIn( unsigned short port )
7 {
8  unsigned char value;
9  __asm__ volatile ("inb %1, %0" : "=a" (value) : "d" (port));
10  return (int)value;
11 }
12 
13 int fb_hOut( unsigned short port, unsigned char value )
14 {
15  __asm__ volatile ("outb %0, %1" : : "a" (value), "d" (port));
16  return FB_RTERROR_OK;
17 }