

DATA_6E	 EQU	0F00H

  
SEG_A		SEGMENT BYTE PUBLIC
		ASSUME CS:SEG_A , DS:SEG_A , SS:STACK_SEG_B
  
  
  
ACTIVE17	PROC	FAR
  
START:
		MOV	CS:DATA_4,ES
		MOV	AX,3508H
		INT	21H
		MOV	CS:DATA_2,BX
		MOV	WORD PTR CS:DATA_2+2,ES
		MOV	AX,CS
		MOV	DS,AX
		MOV	DX,OFFSET INT_08H_ENTRY
		MOV	AX,2508H
		INT	21H
		MOV	DX,SEG STACK_SEG_B
		SUB	DX,CS:DATA_4
		MOV	AX,3100H
		INT	21H
  
ACTIVE17	ENDP
  
  
INT_08H_ENTRY	PROC	FAR
		PUSH	AX
		PUSH	BX
		PUSH	CX
		PUSH	DX
		PUSH	SI
		PUSH	DI
		PUSH	DS
		PUSH	ES
		PUSHF
		CALL	DWORD PTR CS:DATA_2
		DEC	CS:DATA_1
		JZ	LOC_1
		JMP	SHORT LOC_6
		DB	90H
LOC_1:
		MOV	CS:DATA_1,1F4H
		MOV	AX,0B800H
		MOV	DS,AX
		MOV	CX,1F40H
		MOV	DX,15B3H
  
LOCLOOP_2:
		XOR	DX,CX
		ROR	DX,1
LOC_3:
		CMP	DX,50H
		JB	LOC_4
		SUB	DX,50H
		JMP	SHORT LOC_3	
LOC_4:
		MOV	DI,DX
		ADD	DI,DX
		ADD	DI,DATA_6E
		MOV	SI,DI
		SUB	SI,0A0H
		MOV	BX,18H
LOC_5:
		MOV	AX,[SI]
		MOV	[DI],AX
		SUB	SI,0A0H
		SUB	DI,0A0H
		DEC	BX
		JNZ	LOC_5
		MOV	WORD PTR [DI],0
		LOOP	LOCLOOP_2
  
LOC_6:
		POP	ES
		POP	DS
		POP	DI
		POP	SI
		POP	DX
		POP	CX
		POP	BX
		POP	AX
		IRET
INT_08H_ENTRY	ENDP
  
DATA_1		DW	1F4H
DATA_2		DW	0, 9316H
DATA_4		DW	9316H
		DB	0, 0, 0, 0
  
SEG_A		ENDS
  
  
  
  
STACK_SEG_B	SEGMENT	WORD STACK
  
		DB	128 DUP (0)
  
STACK_SEG_B	ENDS
  
  
  
		END	START
