# I/O ports

This module exposes the "IN" and "OUT" i386 operations.

p@ ( port -- n )  32-bit read of "port".
pw@ ( port -- n ) 16-bit read of "port".
pc@ ( port -- n ) 8-bit read of "port".
p! ( n port -- )  32-bit write to "port".
pw! ( n port -- ) 16-bit write to "port".
pc! ( n port -- ) 8-bit write to "port".

## port8/port16/port32 types

This unit also provides types [lib/type] mapping to ioport IN/OUT:

  port8  --> pc@  pc!
  port16 --> pw@  pw!
  port32 --> p@   p!

This allows you to create structures in this fashion:

  struct PS2Ports {
    +$60 port8 ps2data ;
    +$64 port8 ps2cmd ;
  }
  NULLPTR PS2Ports bindstruct

Almost 100% of the time, you'll want such structures to be bound. Not
necessarily to 0 as above, but bound nonetheless.
