;[]-------------------------------------------------------------------------[]
;|	Program name: A_2.ASM                                                |
;|	Image   file: A_2.COM                                                |
;|	Note        : This is not a TSR program.                             |
;|		      This program is used to show the interrupt 00H.        |
;|		      It must be compiled in 80286 instruction mode.         |
;[]-------------------------------------------------------------------------[]

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

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

old_int00	dd	?
old_int61	dd	?
count		db	6

;------- Include area ------------------

DEBUG		EQU	1
include	register.inc
include	interrup.inc
include	debug.inc

;------- Interrupt subroutine ----------

new_int00	proc	far

	dec	count			; If count is not zero, it will display
	jz	@@1			; all the registers value
	jmp	near ptr new_int61
@@1:
	add	sp,2			; Else it will return to the address of
	push	offset next		; 'next' instruction.
	iret

new_int00	endp

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

initialize:

	assume	cs:cseg,ds:cseg

	get_int	00H,old_int00
	set_int	00H,<offset new_int00>
	get_int	61H,old_int61
	set_int	61H,<offset new_int61>

	int	00H			; Let CPU generates the interrupt 00H
next:
	assume	cs:cseg,ds:nothing

	set_int	00H,<word ptr old_int00>,<word ptr old_int00[2]>
	set_int	61H,<word ptr old_int61>,<word ptr old_int61[2]>

	mov	ah,4CH
	int	21H

cseg	ends
	end	start
