home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / TNH_PC.ZIP / WHITHEAD.NL < prev    next >
Encoding:
Text File  |  1987-01-14  |  1.1 KB  |  40 lines

  1. Disabling Break in a BASIC Program
  2.  
  3.            Randy Whitehead
  4.        Dallas IBM PC User Group
  5.  
  6. Sometimes it is desirable to disable
  7. the (CNTL-BREAK) key in a Basic
  8. program.  This is one technique that
  9. may be used.
  10.  
  11. As keys are depressed on the
  12. keyboard a hardware interrupt is
  13. generated.  This interrupt (&h09) is
  14. handled by the BIOS keyboard
  15. interrupt routine (page A25 of the
  16. Technical Reference Manual). As BIOS
  17. reads the character from the
  18. keyboard buffer it tests to see if
  19. it is a special function such as
  20. (CNTL-ALT-DELETE) or (CNTL-BREAK).
  21. If it is (CNTL-BREAK), the keyboard
  22. routine issues a new interrupt
  23. (&H16).  When the new interrupt is
  24. issued, a new routine is invoked to
  25. handle the (CNTL-BREAK).  By
  26. ignoring the new interrupt, the
  27. (CNTL-BREAK) key will be disabled.
  28. This program changes the vector or
  29. pointer to the break interrupt
  30. routine to point to an "IRET"
  31. instruction that will ignore the
  32. character.  The program follows:
  33.  
  34. 10 DEF SEG = &H0
  35. 20  POKE &H6C, &H53
  36. 30  POKE &H6D, &HFF
  37. 40  POKE &H6E, &H0
  38. 50  POKE &H6F, &HF0
  39. 60 DEF SEG
  40.