⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ns338.asm

📁 X86 GX1 BOOTLOAD代码 ,支持WINCE操作系统!
💻 ASM
字号:
;**************************************************************************
;*
;*  NS338.ASM
;*
;*  Copyright (c) 1999 National Semiconductor Corporation.
;*  All Rights Reserved.
;*
;*  Function:
;*    Set up the NS 338 SuperIO and determine if it's alive.
;*
;*  $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	0h, 0FFH

NS_INIT_COUNT EQU ($ - NS_INIT_TABLE)

;**************************************************************************
;*
;*	sioTest
;*
;*	Entry:
;*	Exit:
;*	Destroys:
;*
;**************************************************************************
sioTest PROC NEAR PUBLIC

	mov	gs, bx
	
	PORT80	P80_SIO			; Indicate Entrance to SIO code

ns317_base	equ	2Eh
;gpio_base	equ	0E0h
gpio_base	equ	0E8h
;pm_base	equ	0E8h
pm_base		equ	0E0h

	mov	cx, NS_INIT_COUNT
	lea	si, NS_INIT_TABLE
	mov	dx, ns317_base
nsloop:
	mov	al, cs:[si]
	inc	si
	out	dx,al
	xor	dl,1
	loop nsloop



;
; 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

;
; Cx5530 Initialization. Configure Registers 50-53 to
;  Reg50[2:0] Set ISA clock divisor according to PCI Bus speed
;  Reg50[6:3] PIT 0 and 1 enables
;  Reg51[7:0] Set I/O recovery time
;  Reg52[0]   Enable lower ROM decode
;  Reg52[3]   Enable port 92
;  Reg52[4]   Enable A20M# deassertion on warm reset
;  Reg52[7]   Enable fast keyboard gate A20 and fast reset disable
;  Reg53[1]   RSVD
;  

	mov	esi, 0299447Bh		; See above description
	mov	eax, CX55x0_ID
	mov	ax, CX5530_REG50
	NOSTACK	bx,  Cy55x0RegRead32
	and	edx, 0FF000000h
	or	edx, esi
	mov	eax, CX55x0_ID
	mov	ax, CX5530_REG50
	NOSTACK	bx, Cy55x0RegWrite32

	mov	bx, gs
	jmp	bx

sioTest ENDP

_TEXT ENDS

	END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -