;[]-------------------------------------------------------------------------[]
;|	Program name: 5_1_4.ASM                                              |
;|	Image   file: 5_1_4.COM                                              |
;|	Note        : This program CAN be executed.                          |
;[]-------------------------------------------------------------------------[]


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

;------- Data area ---------------------

no_use	db	?
cs_ip	label	dword
	dw	offset terminate
	dw	-10H
ter_msg	db	'Protection program terminate!',0DH,0AH,'$'
PSP	dw	0

;------- Initial procedure -------------

initialize:

	mov	cs:PSP,ds
	mov	ax,cs
	mov	ds,ax
	mov	es,ax

;=======================================
; Your checking program can be inserted here.
;=======================================

	mov	ax,cs:PSP		; set cs:ip
	mov	ds,ax
	mov	es,ax
	add	ax,10H
	add	word ptr cs:cs_ip[2],ax
	jmp	cs:cs_ip

terminate:

	mov	ax,cs
	mov	ds,ax
	mov	dx,offset ter_msg
	mov	ah,09H
	int	21H

	mov	ah,4CH
	int	21H

cseg	ends
	end	start
