15
12.3
EXAMPLE 3(USING ASSEMBLY LANGUAGE)
Write a short paragraph of assembly language to read the input buffer.
己知
RAM.
Program is as follows: ( BASE the I/O base address set)
MOV
DX
,
BASE
;
Set Dx as I/O index register
MOV AX
,
GENERAL_ INPUT
;
put address
of GENERAL_ INPUT
in AX
OUT
DX
,
AX
;
write to setup index register
MOV DX
,
BASE+2
;
Set up Dx for data R/W
IN AX
,
DX
;
read data from
GENERAL_ INPUT
register