>ただ、I/O関係が難しい...
水野さんのOSがどのプラットホームで動作させたいのか分りませんが、
Windows上(DLL無し)でI/O系の命令をすることは出来ます。
但し、WindowsNT系はデバイスドライバ(ioscm.sysなど)が必要です。
Windows9x系の場合は
#module
#defcfunc io_inp int adr
prm=adr : res=callfunc( prm, varptr(fnIo_inp9x), 1) : return res
#defcfunc io_inpw int adr
prm=adr : res=callfunc( prm, varptr(fnIo_inpw9x), 1) : return res
#defcfunc io_inpd int adr
prm=adr : res=callfunc( prm, varptr(fnIo_inpd9x), 1) : return res
#deffunc io_out int adr, int dt
prm=adr,dt : res=callfunc( prm, varptr(fnIo_out9x), 2 ) : return
#deffunc io_outw int adr, int dt
prm=adr,dt : res=callfunc( prm, varptr(fnIo_outw9x), 2 ) : return
#deffunc io_outd int adr, int dt
prm=adr,dt : res=callfunc( prm, varptr(fnIo_outd9x), 2 ) : return
#deffunc _InitIO
; ****************************************************************************
dim fnIo_inp9x,4 ;io_inp
fnIo_inp9x=0x24548B66,0xFF25EC04,0xC3000000
; ----------------------------------------------------------------------------
; adr. machine assembler
; ----------------------------------------------------------------------------
; 0000 668b542404 mov dx,[esp+04]
; 0005 ec in al,dx
; 0006 25ff000000 and eax,000000ff
; 000b c3 ret
; ****************************************************************************
dim fnIo_inpw9x,4 ;io_inpw
fnIo_inpw9x=0x24548B66,0xFF25ED04,0xC30000FF
; ----------------------------------------------------------------------------
; adr. machine assembler
; ----------------------------------------------------------------------------
; 0000 668b542404 mov dx,[esp+04]
; 0005 ed in eax,dx
; 0006 25ffff0000 and eax,0000ffff
; 000b c3 ret
; ****************************************************************************
dim fnIo_inpd9x,4 ;io_inpd
fnIo_inpd9x=0x24548B66,0x00C3ED04
; ----------------------------------------------------------------------------
; adr. machine assembler
; ----------------------------------------------------------------------------
; 0000 668b542404 mov dx,[esp+04]
; 0005 ed in eax,dx
; 0006 c3 ret
; ****************************************************************************
dim fnIo_out9x,8 ;io_out
fnIo_out9x=0x24548B66,0x24448A04,0x00C3EE08
; ----------------------------------------------------------------------------
; adr. machine assembler
; ----------------------------------------------------------------------------
; 0000 668b542404 mov dx,[esp+04]
; 0005 8a442408 mov al,[esp+08]
; 0009 ee out dx,al
; 000a c3 ret
; ****************************************************************************
dim fnIo_outw9x,8 ;io_outw
fnIo_outw9x=0x24548B66,0x448B6604,0xEF660824,0x000000C3
; ----------------------------------------------------------------------------
; adr. machine assembler
; ----------------------------------------------------------------------------
; 0000 668b542404 mov dx,[esp+04]
; 0005 668b442408 mov ax,[esp+08]
; 000a 66ef out dx,ax
; 000c c3 ret
; ****************************************************************************
dim fnIo_outd9x,8 ;io_outd
fnIo_outd9x=0x24548B66,0x24448B04,0x00C3EF08
; ----------------------------------------------------------------------------
; adr. machine assembler
; ----------------------------------------------------------------------------
; 0000 668b542404 mov dx,[esp+04]
; 0005 8b442408 mov eax,[esp+08]
; 0009 ef out dx,eax
; 000a c3 ret
; ****************************************************************************
return
#global
_InitIO