{ ==================================================================== I/O interface to WINIO.DLL V 2.0 from www.internals.com - 02-21-05 globalchimes at yahoo dot ca } { -------------------------------------------------------------------- This requires WINIO.DLL WINIO.VXD and WINIO.SYS to be in the system path The install procedure placed the proper files in their directories. -------------------------------------------------------------------- } marker winio LIBRARY WINIO.DLL OPENDLLS 0 IMPORT: InitializeWinIo ( -- returns a bool flag but requires nothing to call it) 0 IMPORT: ShutdownWinIo ( void ) 3 IMPORT: MapPhysToLin ( PBYTE pbPhysAddr, DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle -- address) 2 IMPORT: UnmapPhysicalMemory ( HANDLE PhysicalMemoryHandle, PBYTE pbLinAddr -- bool ) 2 IMPORT: GetPhysLong ( PBYTE pbPhysAddr, PDWORD pdwPhysVal -- bool ) 2 IMPORT: SetPhysLong ( PBYTE pbPhysAddr, DWORD dwPhysVal -- bool ) 3 IMPORT: GetPortVal ( WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize -- bool ) 3 IMPORT: SetPortVal ( WORD wPortAddr, DWORD dwPortVal, BYTE bSize -- bool ) 2 IMPORT: InstallWinIoDriver ( PSTR pszWinIoDriverPath, bool IsDemandLoaded = false -- bool ) 0 IMPORT: RemoveWinIoDriver ( -- returns a bool flag but requires nothing to call it) \ Note: All bool values must be masked with $0FF to be valid here. : /WINIO ( -- ) InitializeWinIo $0FF AND 0= THROW ; : WINIO/ ( -- ) ShutdownWinIo drop ; 2variable portval variable port 3 constant rd_dword 2 constant rd_word 1 constant rd_byte : winio_P2@ ( port -- d ) portval rd_dword GetPortVal drop portval 2@ ; : winio_P@ ( port -- n ) portval rd_word GetPortVal drop portval 2@ swap drop ; : winio_PC@ ( port -- n ) portval rd_byte GetPortVal drop portval 2@ swap drop ; : winio_P2! ( d port -- ) swap drop swap rd_dword SetPortVal drop ; : winio_P! ( n port -- ) swap rd_word SetPortVal drop ; : winio_PC! ( n port -- ) swap rd_byte SetPortVal drop ;