[net.micro.pc] Return codes from resident routines on INT 16H

madd@bucsb.bu.edu.UUCP (Jim Frost) (09/04/86)

Another question for you wizards:  what should a resident routine that
intercepts INT 16H return for registers and flags?  I want to make it seem
that no key had been pressed.  Also, what INT numbers are safest?  Currently
I use INT 6FH, but there are some problems sometimes.  Is there better?
How can you tell if an interrupt is being used (if there is any other besides
return-interrupt-vector function in MS-DOS).

Thanx.

+--------------------------------------+---------------------------------+
! Jim Frost                            ! "You just gotta smile through   !
! UUCP:    ..!harvard!bu-cs!bucsb!madd ! it" -- John Reardon             !
! ARPANET: madd@bucsb.bu.edu           !                                 !
! CSNET:   madd%bucsb@bu-cs            ! mv flames /dev/null             !
! BITNET:  cscc71c@bostonu             !                                 !
+--------------------------------------+---------------------------------+

thj@hpcnof.UUCP (Thomas Hjellming) (09/05/86)

>  what should a resident routine that
>intercepts INT 16H return for registers and flags?  I want to make it seem
>that no key had been pressed.

    Jim,

      You can find this information in Peter Norton's 'Programmers Guide
to the IBM PC'.  I will summarize the info here.

     The subfunctions under Int 16h are:

  AH input value          Register outputs             Description

       0                   AH = scan code        Inputs the next character
                          (auxiliary byte)       from the keyboard.  If one
                                                 is not available, control is
                           AL = character code   not returned until a key is
                          (main byte)            pressed.

       1                   ZF = 0 if key is      Check to see if a key has
                             available, else 1.  been pressed.  NOTE:  if
                           AH and AL are set     a key has been pressed, you
                           according to above    can determine what it is
                           if ZF = 0.            using the AH & AL settings.
                                                 However, the character is not
                                                 cleared out of the keyboard
                                                 input buffer.  i.e. do a
                                                 Int 16h w/AH=0 to clear it
                                                 out.

       2                   AL = shift status.    Get current shift status.
                          bit 0 = 1 if right shift is depressed.
                              1 = 1 if left shift is depressed.
                              2 = 1 if Ctrl is depressed.
                              3 = 1 if Alt is depressed.
                              4 = 1 if Scroll Lock is active
                              5 = 1 if Num Lock is active
                              6 = 1 if Caps Lock is active
                              7 = 1 if Insert state is active

    There are more AH subfunctions for the PC JR but who cares about the
Peanut anyway?

    I hope this helps you.

Tom Hjellming
Colorado Networks Division
Hewlett-Packard
Fort Collins, CO

...!hplabs!hpfcla!thj

( All the normal disclaimers )