home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / NOBOOT.ZIP / NOBOOT.ASM next >
Encoding:
Assembly Source File  |  1991-10-23  |  3.0 KB  |  93 lines

  1. ; NOBOOT is a TSR that stops the <Ctrl><Alt><Del> keyboard reset.
  2. ; There ares no unloading provisions.
  3. ; This TSR should be loaded before others.
  4.  
  5. ; ASM source from Debug script in PC Mag. and Sourcer
  6. ;-- Program begins: ---------------------------------------------------------
  7. ;
  8. ; Equates:
  9. ;
  10. kb_data         equ     60h             ;keyboard data port
  11. kb_ctrl         equ     61h             ;keyboard control port
  12. del_key         equ     53h             ;scan code for 'DEL' key
  13. alt_key         EQU     8               ;shift code for Alt key
  14. ctrl_key        EQU     4               ;shift code for Ctrl key
  15. status_byte     equ     417h            ;shift status byte
  16.   
  17. seg_a        segment    byte public
  18.         assume    cs:seg_a, ds:seg_a
  19.   
  20.   
  21.         org    100h
  22.   
  23. noboot        proc    far
  24.   
  25. start:
  26.                 jmp     short   initialize
  27.  
  28. old_vec         label   dword
  29. old_vec1        dw      0       ; put old 9h vector here
  30. old_vec2        dw      0
  31.  
  32. noboot          endp
  33.   
  34. ;==========================================================================
  35. ;
  36. ;               Int 9H
  37. ;
  38. ;==========================================================================
  39.   
  40. int_9h          proc    far
  41.         sti                ; Enable interrupts
  42.         push    ax
  43.         push    ds
  44.                 in      al,kb_data              ; read keyboard
  45.                 cmp     al,del_key              ; was Del key ?
  46.                 jnz     old_int9h               ; no, continue old 9h
  47.                 mov     ax,0                    ;setup for shift keys
  48.         mov    ds,ax
  49.                 mov     al,ds:[status_byte]     ; get shift status
  50.                 test    al,alt_key              ; Alt key  down ?
  51.                 jz      old_int9h               ; no, continue old 9h
  52.                 test    al,ctrl_key             ; Ctrl key down ?
  53.                 jz      old_int9h               ; no, continue old 9h
  54.                 in      al,kb_ctrl              ; ackknowledge keystroke
  55.                 mov     ah,al                   ;  so key won't be around
  56.                 or      al,80h                  ;  later
  57.                 out     kb_ctrl,al
  58.         mov    al,ah
  59.                 out     kb_ctrl,al
  60.  
  61.                 mov     al,20h                  ; end
  62.                 out     20h,al                  ;  of interrupt
  63.  
  64.                 pop     ds                      ;restore regs
  65.         pop    ax
  66.         iret                ; Interrupt return
  67.   
  68. old_int9h:
  69.         pop    ds
  70.         pop    ax
  71.                 jmp     cs:old_vec              ; do normal 9h int
  72.  
  73. int_9h          endp
  74.  
  75. initialize:
  76.         mov    ax,3509h
  77.                 int     21h                     ; get orignal 9h int vector
  78.                 mov     old_vec1,bx             ; save old vec for later
  79.                 mov     old_vec2,es
  80.                 mov     dx,offset int_9h
  81.         mov    ax,2509h
  82.                 int     21h                     ; set new 9h vec to this code
  83.                 mov     dx,offset initialize
  84.         int    27h            ; Terminate & stay resident
  85. copyright    db    '(c) 1988 Ziff Communications Co.'
  86.         db    0
  87.   
  88. seg_a        ends
  89.   
  90.   
  91.   
  92.         end    start
  93.