Programming Examples - Black Box IC901C Manual

16 relay i/o card
Table of Contents

Advertisement

16 RELAY I/O CARD

2.3 Programming Examples

To set Relay #3 on, write a "1" in bit position 3, to port address Base+2, or 302 Hex.
MOV DX, 302H
MOV AL, 0000 1000B
OUT DX, AL
Another method that takes into account the read-back capability of the output
ports A and B:
MOV DX,302H
IN AL,DX
NOT AL
OR AL,0000 1000B
OUT DX,AL
Reading back the ports (A and B) results in the binary complement of
what you originally output.
10
;Set DX to Port A
;Set BIT 3 TO A "1"
;Set DX To Port A
;Get old port setting
;Invert for negative logic******
;OR in bit 3
;Set Bit 3 w/o altering other bits
NOTE

Advertisement

Table of Contents
loading

Table of Contents