Disable keyboard- uses rarely seen Interrupt

Started by Magnum, October 07, 2009, 10:23:13 PM

Previous topic - Next topic

Magnum


; int20P.asm   VKD_Disable_Keyboard
;                
;  INT 20 P - Microsoft Windows - VKD - VxD SERVICES
; VxD = 000Dh
;  Note: the desired VxD and service number are identified by the data
;  immediately following the INT 20 instruction, as in:
; INT 20h
; DW service number
; DW VxD identifier

.model   small
.486
.stack   200h    

.data


.code

start:                      
        mov      ax,@data
        mov      ds,ax
        INT 20h
  DW      0010h  ; service number - VKD_Disable_Keyboard
  DW      00Dh   ; VxD identifier

exit:
        mov          ax,4c00h
        int          21h

end     start

Have a great day,
                         Andy

japheth

This won't work, because the INT 20h API can be called by Win9x VxDs only. These are FLAT binaries, and won't exit by a ax=4C00h, int 21h.

There might exist an API which the VkD device implements and which can be called by DOS programs (see RBIL for details), but it surely isn't INT 20h.

sinsi

Light travels faster than sound, that's why some people seem bright until you hear them.

dedndave

as far as i remember, INT 20h requires no parameters and terminates a program - lol
if there is some odd-ball use of INT 20h, i bet Ralf Brown's Interrupt list would have it
http://www.cs.cmu.edu/~ralf/files.html

japheth


> as far as i remember, INT 20h requires no parameters and terminates a program - lol

Int 20h real-mode expects CS to contain the current PSP.

> if there is some odd-ball use of INT 20h,

Int 20h in protected-mode was frequently used in the good old days, see http://win32assembly.online.fr/vxd-tut1.html

dedndave

but, but, but, we are in the 16-bit forum, no ?
and - i don't think INT 20h assumes anything about the CS
if you want to access the INT 20h that is at PSP:0000 with a RETN, then yes - CS needs to = PSP

japheth

Quote from: dedndave on October 10, 2009, 02:58:39 PM
and - i don't think INT 20h assumes anything about the CS
if you want to access the INT 20h that is at PSP:0000 with a RETN, then yes - CS needs to = PSP

Perhaps you should follow your own advise given above and read Ralf Brown IL:


--------D-20---------------------------------
INT 20 - DOS 1+ - TERMINATE PROGRAM
CS = PSP segment
Return: never
Notes: (see INT 21/AH=00h)
this function sets the program's return code (ERRORLEVEL) to 00h
SeeAlso: INT 21/AH=00h,INT 21/AH=4Ch


That's why int 20h is - usually - used by DOS COM programs only.

dedndave

ok - you got me, i guess - lol
but, in days of old (before int 21h, function 4Ch), i seem to recall EXE's pushing the PSP and a 0 for a RETF exit
which i see now, does set CS to the PSP

rags

OT-Japeth what kind of bird is that in you avatar pic?
God made Man, but the monkey applied the glue -DEVO

japheth

QuoteOT-Japeth what kind of bird is that in you avatar pic?

The European Jay

Here's a more detailed pic: http://www.japheth.de/jay1.png

Magnum

Quote from: japheth on October 10, 2009, 08:55:01 AM
This won't work, because the INT 20h API can be called by Win9x VxDs only. These are FLAT binaries, and won't exit by a ax=4C00h, int 21h.

There might exist an API which the VkD device implements and which can be called by DOS programs (see RBIL for details), but it surely isn't INT 20h.

Sure it works.

But it does require Win 95 +.

Check Ralph's list under Int 20P.

Andy



Have a great day,
                         Andy

MichaelW

eschew obfuscation

Magnum

Have a great day,
                         Andy