The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: Magnum on October 07, 2009, 10:23:13 PM

Title: Disable keyboard- uses rarely seen Interrupt
Post by: Magnum on October 07, 2009, 10:23:13 PM

; 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

Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: 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.
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: sinsi on October 10, 2009, 09:06:06 AM

mov al,0adh
out 64h,al

Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: dedndave on October 10, 2009, 09:18:42 AM
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
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: japheth on October 10, 2009, 02:41:26 PM

> 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
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: dedndave on October 10, 2009, 02:58:39 PM
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
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: japheth on October 10, 2009, 03:13:29 PM
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.
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: dedndave on October 10, 2009, 03:27:43 PM
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
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: rags on October 10, 2009, 10:47:47 PM
OT-Japeth what kind of bird is that in you avatar pic?
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: japheth on October 11, 2009, 07:56:37 AM
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
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: Magnum on October 12, 2009, 03:48:31 PM
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



Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: MichaelW on October 12, 2009, 04:36:51 PM
QuoteSure it works.

Define "works".
Title: Re: Disable keyboard- uses rarely seen Interrupt
Post by: Magnum on October 12, 2009, 11:46:55 PM
See attached .exe.