;[]-------------------------------------------------------------------------[]
;|	Program name: 2_4_5.ASM                                              |
;|	Image   file: 2_4_5.COM                                              |
;|	Note        : This is not a TSR program.                             |
;|                    It can remove the TSR program.                         |
;|                    You can rename this program to REMOVE.ASM.             |
;[]-------------------------------------------------------------------------[]


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

;------- Remove Tsr Subroutine ---------

remove		proc	near

	mov	ax,3560H		; get INT 60H interrupt vector
	int	21H

	mov	ax,es			; check the value
	cmp	ax,0000H		; if it is zero
	je	done			; then return

	int	60H			; else trigger INT 60H

	push    es			; save PSP segment address

	mov     ax,es:[2CH]		; get environment segment address
	mov     es,ax			; release MCB1
        mov     ah,49H
	int     21H

	pop     es			; release MCB2
	mov	ah,49H
	int	21H

done:	ret

remove		endp

;------- Main program ------------------

initialize:

	call	remove
	int	20H

cseg	ends
	end	start
