I have some problems whidt INTERUPT 9 i hope
somewane can help me out its works fine under dos
but windows is messing up everefing take a lock
at this code. (it's made for $include file)
DECLARE SUB SetUevent()
DECLARE SUB Kbscan()
dim SGxx as shared word
dim PRxx as shared word
dim OSGxx as shared word 'dim some memory
dim OPRxx as shared word
dim kbcode(255) as shared byte
SGxx=CODESEG(INT9) 'get the new segment addr
PRxx=CODEPTR(INT9) 'get the new pointer addr
CALL GetInterruptVector(&H9,OSGxx,OPRxx) 'save the old addr
ON UEVENT GOSUB KeyPress 'set uevent action
goto skip4it 'skip the interupt proces by startup
KeyPress:
call kbscan
RETURN
INT9:
! PUSH AX 'save the ganeral registers
! PUSH BX
! PUSH CX
! PUSH DX
! PUSH SI
! PUSH DI
! PUSH BP
! PUSH DS
! PUSH ES
! PUSHF 'save the flags register
! CLI 'suspend all maskable interupts
! CALL far ptr setuevent 'call uevent
! POPF 'restore flags
! POP ES 'restore registers
! POP DS
! POP BP
! POP DI
! POP SI
! POP DX
! POP CX
! POP BX
! POP AX
! STI 're-enable all maskable interupts processing
! iret 'return from interupt
sub kbscan
local acode?
local kbscancode%
kbscancode%=inp(&h60) 'read scancode
acode?=inp(&h61) '!!keyboard controlle interupt!!
out &h61,(acode? or &h80) ' its a mistery
out &h61,(acode? and &h7F)
out &h20,&h20
if (kbscancode% and 128) then 'save
kbcode(kbscancode% and 127)=0
else
kbcode(kbscancode% and 127)=1
end if
kbcode(0)=kbscancode%
'--turn off by pressing Ctrl+Alt+Del--
if kbcode(29)=1 and kbcode(56)=1 and kbcode(83)=1 then kbcode.off:beep:end
end sub
sub kbcode.on
CALL SetInterruptVector(&H9,SGxx,PRxx) 'set new addr
for i = 0 to 15 'clean key buffers
dumy$=inkey$
next
uevent on
end sub
sub kbcode.off
CALL SetInterruptVector(&H9,OSGxx,OPRxx) 'restore old addr
uevent off
for i = 0 to 127 'clean scancode buffers
kbcode(i)=0
next
end sub
SUB SetInterruptVector(Intr%,Segment??,Offset??) 'works good
REG 1,&H2500 + Intr%
REG 4,Offset??
REG 8,Segment??
CALL INTERRUPT &H21
END SUB
SUB GetInterruptVector(Intr%,S??,O??) 'works good
REG 1,&H3500 + Intr%
CALL INTERRUPT &H21
S??=REG(9)
O??=REG(2)
END SUB
skip4it: 'skip point
----------------END------------------------------------
If i run under windows it go's wrong
by pressing the cursor-key whats hapening
pleas help me, fanks
------------------
somewane can help me out its works fine under dos
but windows is messing up everefing take a lock
at this code. (it's made for $include file)
DECLARE SUB SetUevent()
DECLARE SUB Kbscan()
dim SGxx as shared word
dim PRxx as shared word
dim OSGxx as shared word 'dim some memory
dim OPRxx as shared word
dim kbcode(255) as shared byte
SGxx=CODESEG(INT9) 'get the new segment addr
PRxx=CODEPTR(INT9) 'get the new pointer addr
CALL GetInterruptVector(&H9,OSGxx,OPRxx) 'save the old addr
ON UEVENT GOSUB KeyPress 'set uevent action
goto skip4it 'skip the interupt proces by startup
KeyPress:
call kbscan
RETURN
INT9:
! PUSH AX 'save the ganeral registers
! PUSH BX
! PUSH CX
! PUSH DX
! PUSH SI
! PUSH DI
! PUSH BP
! PUSH DS
! PUSH ES
! PUSHF 'save the flags register
! CLI 'suspend all maskable interupts
! CALL far ptr setuevent 'call uevent
! POPF 'restore flags
! POP ES 'restore registers
! POP DS
! POP BP
! POP DI
! POP SI
! POP DX
! POP CX
! POP BX
! POP AX
! STI 're-enable all maskable interupts processing
! iret 'return from interupt
sub kbscan
local acode?
local kbscancode%
kbscancode%=inp(&h60) 'read scancode
acode?=inp(&h61) '!!keyboard controlle interupt!!
out &h61,(acode? or &h80) ' its a mistery
out &h61,(acode? and &h7F)
out &h20,&h20
if (kbscancode% and 128) then 'save
kbcode(kbscancode% and 127)=0
else
kbcode(kbscancode% and 127)=1
end if
kbcode(0)=kbscancode%
'--turn off by pressing Ctrl+Alt+Del--
if kbcode(29)=1 and kbcode(56)=1 and kbcode(83)=1 then kbcode.off:beep:end
end sub
sub kbcode.on
CALL SetInterruptVector(&H9,SGxx,PRxx) 'set new addr
for i = 0 to 15 'clean key buffers
dumy$=inkey$
next
uevent on
end sub
sub kbcode.off
CALL SetInterruptVector(&H9,OSGxx,OPRxx) 'restore old addr
uevent off
for i = 0 to 127 'clean scancode buffers
kbcode(i)=0
next
end sub
SUB SetInterruptVector(Intr%,Segment??,Offset??) 'works good
REG 1,&H2500 + Intr%
REG 4,Offset??
REG 8,Segment??
CALL INTERRUPT &H21
END SUB
SUB GetInterruptVector(Intr%,S??,O??) 'works good
REG 1,&H3500 + Intr%
CALL INTERRUPT &H21
S??=REG(9)
O??=REG(2)
END SUB
skip4it: 'skip point
----------------END------------------------------------
If i run under windows it go's wrong
by pressing the cursor-key whats hapening
pleas help me, fanks
------------------
Comment