( Port I/O )
create io@ code[ $5a $ec $c0 $31 $c2 $89 $52 7 bytes ]code
create io! code[ $ad $5a $ee $ad $c2 $89 $52 7 bytes ]code

( Parallel Port )
: par:write 888 io! 13 890 io! 12 890 io! ;

( CMOS Support )
: cmos:read $70 io! $71 io@ ;
: cmos:write $70 io! $71 io! ;

( RTC )
: time? hex $02 cmos:read $04 cmos:read . . decimal ;

( 8-bit VGA Graphics Driver )
15 variable bgColor
: tc 8 * swap 8 * swap ;
: clear color @ bgColor @ 0 0 at color ! hp @ vp @ rect color ! cr 0 0 at ;
: blank-line hp @ 8 bgColor @ color ! rect 0 color ! ;
: scroll 8 0 at hp @ vp @ 16 - 0 0 blit vp @ 16 - 0 at blank-line vp @ 16 - 0 at ;
: setres dup vp ! 8 / vc ! dup hp ! 8 / hc ! clear ;
: vesa ati 640 480 setres ;

320 200 setres 0 color !
save-state
