Write I/O - Octagon Systems XE–700 Reference Manual

Table of Contents

Advertisement

Return registers:
Comments:
Programming example:
/* Inline assembly code for Borland C++ 3.1 */
asm {

Write I/O

Function:
Subfunction:
Purpose:
Calling registers:
Return registers:
Comments:
Programming example:
/* Inline assembly code for Borland C++ 3.1 */
asm {
68
DX
Carry flag cleared if successful
Carry flag set if error
AL
This function is used to initialize the
I/O before normal use.
mov
ax,0ef00h
mov
di,00ffh
mov
bx,55ffh
mov
cx,0000h
mov
dx,0ffffh
int
17h
}
efh
01h
To write a value to an I/O port.
AH
AL
DI
BX
CX
DX
Carry flag cleared if successful
Carry flag set if error
AL
This function is used to initialize the
I/O.
mov
ax,0ef01h
mov
di,00ffh
mov
bx,8000h
mov
cx,0202h
xxxxxxxx
xxxxxxxxB
direction: 1=output, 0=input
ffffh
Error code
/*port A all outputs,
init data=all 0's */
/*port B all outputs,
init data=55h*/
/*port C all inputs*
efh
01h
Port A mask and data
Mask
Data
xxxxxxxx
xxxxxxxxB
Mask: 1=bit to be changed
Port B mask and data
Mask
Data
xxxxxxxx
xxxxxxxxB
Mask: 1=bit to be changed
Port C mask and data
Mask
Data
xxxxxxxx
xxxxxxxxB
Mask: 1=bit to be changed
ffffh
Error code
/*port A: no change */
/*port B: bit 7 set to 0*/
/*port C: bit 1 set to 0*/

Advertisement

Table of Contents
loading

Table of Contents