📄 pre338.asm
字号:
;**************************************************************************
;*
;* PRE338.ASM
;*
;* Copyright (c) 1999 National Semiconductor Corporation.
;* All Rights Reserved.
;*
;* Function:
;* Code to be run before NS 338 SuperIO initialization.
;*
;* $Revision:: 1 $
;*
;**************************************************************************
;.MODEL TINY
.486P
INCLUDE DEF.INC
INCLUDE MACROS.INC
INCLUDE PORT80.INC
INCLUDE 5530.inc
INCLUDE strings.inc
_TEXT SEGMENT PUBLIC use16 'CODE'
EXTERN cy55x0RegRead8:NEAR
EXTERN cy55x0RegWrite8:NEAR
EXTERN cy55x0RegRead32:NEAR
EXTERN cy55x0RegWrite32:NEAR
NS_INIT_TABLE:
DB 00h, 0FFh ; enable all devices
NS_INIT_COUNT EQU ($ - NS_INIT_TABLE)
;**************************************************************************
;*
;* preSioInit
;*
;* Entry:
;* Exit:
;* Destroys:
;*
;**************************************************************************
preSioInit PROC NEAR PUBLIC
mov gs, bx
PORT80 P80_SIO ; Indicate Entrance to SIO code
ns317_base equ 0398h
;gpio_base equ 0E0h
gpio_base equ 0E8h
;pm_base equ 0E8h
pm_base equ 0E0h
mov dx, ns317_base
in al, dx
in al, dx
in al, dx
in al, dx
mov cx, NS_INIT_COUNT
lea si, NS_INIT_TABLE
mov dx, ns317_base
nsloop:
mov al, cs:[si]
inc si
out dx, al
out dx, al
xor dl,1
loop nsloop
mov al,03h ; pmc2
out pm_base,al
xchg al,ah
in al,pm_base+1 ; read it
or al,07h ; mask it
xchg al,ah
out pm_base,al
xchg al,ah
out pm_base+1,al ; out it
mov dx,ns317_base ; ns317
mov al,07h
out dx,al
inc dx
mov al,08h
out dx,al
mov dx,ns317_base ; ns317
mov al,30h
out dx,al
mov al,0
inc dx
out dx,al
;CONFIG GPIO 16 TO BE A LOW OUTPUT
in al,gpio_base+1
or al,40h ; make it an out
out gpio_base+1,al
in al,gpio_base
and al,0BFh ; make it low
out gpio_base,al
;
; Set KBC and RTC to ISA SD bus to enable KBC and RTC decode.
;
mov eax, CX55x0_ID
mov al, CX5530_REG58
NOSTACK bx, Cy55x0RegRead8
mov eax, CX55x0_ID
mov al, CX5530_REG58
or dl, 03h
NOSTACK bx, Cy55x0RegWrite8
mov bx, gs
jmp bx
preSioInit ENDP
_TEXT ENDS
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -