![VersaLogic VL-12CT96 Скачать руководство пользователя страница 54](http://html.mh-extra.com/html/versalogic/vl-12ct96/vl-12ct96_reference-manual_1006747054.webp)
6-6
VL-12CT96/7 Analog & Digital I/O Card
0012 E8 0045 call channel_off
0015 B0 00 mov al,0 ;Acquire ON/OFF state of channel 0
0017 E8 001A call channel_read
001A 72 06 jc on_code ;Execute conditional branch
001C off_code: ;Process OFF code here
001C 90 nop
001D 90 nop
001E 90 nop
001F EB 04 90 jmp stop
0022 on_code: ;Process ON code here
0022 90 nop
0023 90 nop
0024 90 nop
0025 EB FE stop: jmp stop ;Rest of mainline program here
0027 init_par:
init_par:
init_par:
init_par:
init_par: ;Initializes Parallel Port
;AX=Direction Pattern
;1=Output 0=Input
;Turns all output channels off
0027 52 push dx
0028 A3 0000r mov dir,ax ;Save pattern to guarantee we never
;output a “1” to an input channel
002B B8 0000 mov ax,0000h ;Turn all output channels off
002E BA 030A mov dx,parlo
0031 EF out dx,ax
0032 5A pop dx
0033 C3 ret
0034 channel_read:
channel_read:
channel_read:
channel_read:
channel_read: ;Used to read input channels.
;AL=Channel number (00h to 0Fh).
;Carry flag reflects logic state
;of input signal upon exit. Use
;conditional jump instructions
;JC or JNC as appropriate to
;control program flow after
;calling this subroutine.
;Carry=1 if selected input = ON
;Carry=0 if selected input = OFF
0034 52 push dx
0035 8A C8 mov cl,al ;Use CL register as a shift counter
0037 FE C1 inc cl ;Always want at least one shift
0039 BA 030A mov dx,parlo
003C ED in ax,dx ;Read the parallel port registers
003D D3 E0 shl ax,cl ;Shift the channel bit into carry
003F 5A pop dx
0040 C3 ret
0041 channel_on:
channel_on:
channel_on:
channel_on:
channel_on: ;Used to turn an output channel ON
;AL=Channel Number. If an input
;channel is specified, nothing
;happens.
0041 53 push bx
0042 51 push cx
0043 52 push dx
0044 BB 8000 mov bx,8000h ;Setup initial mask position
0047 8A C8 mov cl,al ;Use channel # as rotate counter
Software Examples — Parallel Port
Содержание VL-12CT96
Страница 2: ...ii VL 12CT96 7 Analog Digital I O Card ...
Страница 26: ...2 20 VL 12CT96 7 Analog Digital I O Card ...
Страница 32: ...3 6 VL 12CT96 7 Analog Digital I O Card ...
Страница 62: ...7 4 VL 12CT96 7 Analog Digital I O Card ...
Страница 65: ...VL 12CT96 7 Analog Digital I O Card 8 3 VL 12CT96 7 Parts Placement Reference ...