;[]-------------------------------------------------------------------------[]
;|	Program name: 2_2_8.ASM                                              |
;|	Image   file: 2_2_8.COM                                              |
;|	Note        : The basic TSR program.                                 |
;|                    It is chained with INT 08H interrupt service routine.  |
;|                    It does nothing but waste the time.                    |
;|                    You can rename this program to DELAY.ASM.              |
;[]-------------------------------------------------------------------------[]


cseg	segment
	assume	cs:cseg,ds:cseg
	org	100H
start:
	jmp	initialize

;---------------------------------------

old_int08	dd	?

;---------------------------------------

new_int08	proc	far

	pushf				; Run the old INT 08H routine
	call	cs:old_int08

	sti

	push	cx			; Save the register value

	mov	cx,1000H		; Delay
i08_1:	loop	i08_1

	pop	cx			; Restore the register value

	iret

new_int08	endp

;---------------------------------------

initialize:

	mov	al,08H			; Get the INT 08H interrupt vector
	mov	ah,35H
	int	21H

	mov	word ptr old_int08,bx	; Save the vector in old_int08
	mov	word ptr old_int08[2],es

	mov	dx,offset new_int08	; Set the INT 08H interrupt vector
	mov	al,08H
	mov	ah,25H
	int	21H

	mov	dx,offset initialize	; Terminate and stay resident
	int	27H

cseg	ends
	end	start