NAR-5050/5070 Series User
’
s Manual
53
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.
mov al,bl ; Get GPDO data
out dx,al ; Program GPDO
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]
ret ; Return
LOOP_GPO_BITS ENDP
;---------------------------------------------------------------;
; FIXED_DELAY ;
;---------------------------------------------------------------;
; Input : (CX) count of 15 microseconds to wait ;
; STACK PRESENT ;
; Output: NONE ;
; Register destroyed : (CX) ;
; ;
; This routine is called to wait for 15 microseconds * count in ;
; (CX), then return. Gives a programmed software delay. ;
;---------------------------------------------------------------;
FIXDELAY PROC NEAR
push dx
push ax
pushf
mov dx,61h
in al,dx ;
jmp $+2
jmp $+2
and al,00010000b ;
mov ah,al ;
fixed_delay_1:
in al,dx ;
jmp $+2
jmp $+2
and al,00010000b ;
cmp al,ah ;
jz short fixed_delay_1 ;
mov ah,al ;
loop short fixed_delay_1 ;
popf
pop ax ;