home *** CD-ROM | disk | FTP | other *** search
-
- OLD_INT_16 DD 0 ; TSR install stores old INT 16H vector here.
- ...
- ...
- ...
- NEW_INT_16: ; TSR install points INT 16H vector to here.
- STI
- CMP AH,00H ; Request = 00H (get keystroke)?
- JE CALL_BIOS ; ..yes, then CALL BIOS
- ; (and then back to us)
- JMP CS:OLD_INT_16 ; ..no, just JMP to BIOS
- ; (it'll IRET to user)
- CALL_BIOS:
- PUSHF ; Simulate INT so BIOS's IRET returns to us
- CALL CS:OLD_INT_16 ; call BIOS INT 16H handler
- ; now we're back...
- PUSHF ; Save any flags from the BIOS routine
- CMP AX,CS:HOT_KEY ; Is it our hot key?
- JE TSR_MAINLINE ; ..yes, go do the TSR's thing
- POPF ; ..no, go back to user...
- IRET
- ...
- ...
-