4 - 3


MOV DX,CS:CHANNEL ;

CMP CX,1 ; 1 ?

JA INPUT_WORD ; - ..

INPUT_BYTE:

IN AX,DX

TEST AH,7FH

JZ INPUT_BYTE

MOV ES:[DI],AL

JMP QUIT_INPUT

INPUT_WORD:

CMP CX,2

JA INPUT_BLOCK

IN AX,DX

MOV ES:[DI],AX

JMP QUIT_INPUT

INPUT_BLOCK:

IN AX,DX

TEST AH,7FH

JZ INPUT_BLOCK

MOV ES:[DI],AL

INC DI

LOOP INPUT_BLOCK

QUIT_INPUT:

POP ES

JMP QUIT

OUTPUT_DATA:

PUSH ES

LES DI,ES:[BX]+14 ;

MOV AX,ES:[DI]

MOV CS:CHANNEL,AX

POP ES

;---,

QUIT: OR ES:WORD PTR [BX]+3,100H ; 8

POPA ;

POP DS

POP ES

RET

E_O_P: ;

ADC_DRV ENDP

CSEG ENDS

END ADC_DRV