04 WinIO
\ 先將 winio.vxd winio.dll winio.sys winio.bas COPY 到 win32forth 執行路徑下
\ 再 fload winio.f
\
\ 鍵入 print_on 燈亮
\
\ 鍵入 print_off 燈滅
\
create I/O_Prot$ 256 allot
\ Vc++: void Fun( a1,a2,a3);
\ forth: a3 a2 a1 call Fun
WinLibrary WinIo.dll
: WinPC! ( data I/O_PortNumber --- )
call InitializeWinIo drop
1 rot rot Call SetPortVal drop
call ShutdownWinIo drop
;
: WinPC@ ( I/O_PortNumber --- data )
call InitializeWinIo drop
1 I/O_Prot$ rel>abs rot Call GetPortVal drop
call ShutdownWinIo drop
I/O_Prot$ c@
;
\ 範例
: print_on
0xff 0x378 WinPC!
;
: print_off
0x00 0x378 WinPC!
;