;CTRL-B1.8 - TSR which hooks interrupt 1Bh (CTRL-Break response) ; Like CTRL-B2, but does not call the old handler MAIN: MOV AX,251Bh ;Function 25h: Set interrupt vector 1Bh MOV DX,NEWINT ;Offset of handler INT 21h ;Int 21h: Function 25h MOV DX,16h ;Set 16h paragraphs to stay resident MOV AH,31h ;Function 31h: Terminate and stay resident INT 21h ;Int 21h: Function 31h NEWINT: PUSH DX ;Save DX register PUSH DS ;Save DS register MOV DX,MSG ;Address of string MOV DS,CS ;Set Data Segment to Code Segment CALL OUTSTR ;Output string POP DS ;Restore DS register POP DX ;Restore DX register IRET ;Return from interrupt handler OUTSTR: PROC ;Output string procedure PUSHA ;Save registers MOV AH,0Fh ;Function 0Fh: Get video mode (active page in BH) INT 10h ;Int 10h: Function 25h MOV DI,DX ;Address of start of string MOV AH,0Eh ;Function 0Eh: Teletype Output MOV BL,0Fh ;Text color for graphics modes NCHAR: MOV AL,[DI] ;Get character INC DI ;Move string pointer to next character CMP AL,'$' ;Check for end of string JE ESTR ;Return if found INT 10h ;Int 10h: Function 0Eh JMP NCHAR ;Do next character ESTR: POPA ;Restore registers RET ;Return ENDP ;End of procedure MSG: DB 'Hello World$' ;String to output, '$' terminated