home *** CD-ROM | disk | FTP | other *** search
- Disabling Break in a BASIC Program
-
- Randy Whitehead
- Dallas IBM PC User Group
-
- Sometimes it is desirable to disable
- the (CNTL-BREAK) key in a Basic
- program. This is one technique that
- may be used.
-
- As keys are depressed on the
- keyboard a hardware interrupt is
- generated. This interrupt (&h09) is
- handled by the BIOS keyboard
- interrupt routine (page A25 of the
- Technical Reference Manual). As BIOS
- reads the character from the
- keyboard buffer it tests to see if
- it is a special function such as
- (CNTL-ALT-DELETE) or (CNTL-BREAK).
- If it is (CNTL-BREAK), the keyboard
- routine issues a new interrupt
- (&H16). When the new interrupt is
- issued, a new routine is invoked to
- handle the (CNTL-BREAK). By
- ignoring the new interrupt, the
- (CNTL-BREAK) key will be disabled.
- This program changes the vector or
- pointer to the break interrupt
- routine to point to an "IRET"
- instruction that will ignore the
- character. The program follows:
-
- 10 DEF SEG = &H0
- 20 POKE &H6C, &H53
- 30 POKE &H6D, &HFF
- 40 POKE &H6E, &H0
- 50 POKE &H6F, &HF0
- 60 DEF SEG