NAR-5050/5070 Series User
’
s Manual
42
LOOP_GET_GPI_CARRY PROC NEAR
mov dx,Index_IO_Port ; Program GPSEL first ( port# and Pin# )
mov al,GPSEL
out dx,al
mov dx,Data_IO_Port
mov al,bl ;
out dx,al
mov dx,Index_IO_Port ; Program GPCFG1 ( port dir. type,..)
mov al,GPCFG1
out dx,al
mov dx,Data_IO_Port
mov al,bh ;
out dx,al
ror ebx,10h ; Swap EBX High and low word
ror edx,10h ; Get GPIO I/O Base Addr to DX.
xor ax,ax
mov al,bh ; Get Offset Addr value
add dx,ax ; Point to Offset Addr.
in al,dx ; Get GPDI
push ax ; save al to stack
mov al,bh ; DX Back to I/O Base Addr.
sub dx,ax ;
rol edx,10h ; Restore GPIO I/O Base Addr to
; EDX_Bit[31..16]
pop ax ; restore al from stack
xor bh,bh ; bh=0 for bit test ( need BX )
bt ax,bx ; MASK bit relates to the GPI pin status.
; copy the bit to carry flag and return
ret ; Return
LOOP_GET_GPI_CARRY ENDP
;-----------------------------------------------------------------------;
; GPO_OUT_BYTE_DH ;
;-----------------------------------------------------------------------;
; GPO_OUT_BYTE_DH ( Output GPO value from DH ) ;
; ;
; Index_IO_Port : NS PC87417 Index I/O Port = 2Eh ;
; Data_IO_Port : NS PC87417 Data I/O Port = 2Fh ;
; GPIO_LDN : System Wake-Up Control Logical Device Number = 07 ;
; GPSEL : Index 0F0h from GPIO LDN ; ;
; Set Port# (Bit 6-4), and Pin# (Bit2-0) ;