I/O input program examples
To configure ports A and C as inputs and port B as outputs, issue the following
commands:
OUT 123h, 2 ‘Direction Mode’
OUT 120h, 0
OUT 121h, FF
OUT 122h, 0
OUT 123h, 3 ‘Operation Mode’
To read ports A and C, issue the following commands:
PORTA = INP(120h) (port A)
PORTC = INP(122h) (port C)
Enhanced INT 17h function definitions
This section provides definitions for the following functions using the INT17
handler, I17HNDLR.EXE: Initialize I/O, Write I/O, and Read I/O.
I17HNDLR.EXE is a TSR program and is called out by the XE–700 SBC BIOS. By
default, when the “X” switch is on, the INT17 extended BIOS is operational. If the
“X” switch is Off and DOS is the operating system, the I17HNDLR.EXE TSR can be
used. Once executed, the TSR is active, but it must be executed each time the
system is rebooted. Copy the I17HNDLR.EXE utility to your boot device and add it
to your AUTOEXEC.BAT.
Note
The INT17 functions can only be used with DOS operating systems. If you use a
different operating system, the INT17 functionality can still be used by your
application but must be integrated into your software.
Initialize I/O
Function: efh
Subfunction: 00h
Purpose:
To set the directions and to program the
initial values of an I/O port.
Calling registers:
Ah
efh
AL
00h
DI
Port A configuration
Initial Data Direction Mask
xxxxxxxx
xxxxxxxxB
direction: 1=output, 0=input
BX
Port B configuration
Initial Data Direction Mask
xxxxxxxx
xxxxxxxxB
direction: 1=output, 0=input 0->input
CX
Port C configuration
Initial Data Direction Mask
67