;[]-------------------------------------------------------------------------[]
;|	Program name: 2_2_7.ASM                                              |
;|	Image   file: 2_2_7.COM                                              |
;|	Note        : The basic TSR program.                                 |
;|                    It is chained with INT 08H interrupt service routine.  |
;|                    When this program was resident in memory, your screen  |
;|                      will scroll down in 18.2 lines per second.           |
;[]-------------------------------------------------------------------------[]


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	ax			; Save the register value
	push	bx
	push	cx
	push	dx

	mov	ah,7			; Scroll screen down one line
	mov	al,1
	mov	bh,7
	mov	ch,0
	mov	cl,0
	mov	dh,24
	mov	dl,79
	int	10H

	pop	dx			; Restore the register value
	pop	cx
	pop	bx
	pop	ax

	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