cmos.asm

来自「[随书类]Dos6.0源代码」· 汇编 代码 · 共 79 行

ASM
79
字号
;===========================================================================
COMMENT	#

 CMOS.ASM

	Copyright (c) 1991 - Microsoft Corp.
	All rights reserved.
	Microsoft Confidential

 Functions to read information from CMOS RAM
 Converted from Windows 3.0 installation code

END COMMENT #
;===========================================================================

CMOS_PORT	EQU	70H
CMOS_DATA       EQU	71H
CMOS_REG_D2     EQU	1AH
EXT_MEM_LOW	EQU	17h
EXT_MEM_HIGH	EQU	18h

;***************************************************************************

INCLUDE model.inc

.CODE

;---------------------------------------------------------------------------
; Reads into AL into the byte location in CMOS RAM as specified in
; in AH on entry
;
; ENTRY:	AH = Byte offset in CMOS RAM
; RETURNS:	AL = Byte from CMOS memeory
;
;---------------------------------------------------------------------------

ReadCmos   PROC

	mov	AL,AH
	cli
	out	CMOS_PORT, AL
	jmp	SHORT @F
@@:
	in	AL,CMOS_DATA
	sti
	ret

ReadCmos ENDP

;---------------------------------------------------------------------------
; Writes the byte in AH into the byte location in CMOS RAM as specified
; in AL
;
; ENTRY:	AH = Byte offset in CMOS RAM
;		AL = Byte to write at CMOS RAM offset
;
;---------------------------------------------------------------------------

WriteCmos   PROC

	xchg	AH,AL

	cli

	out	CMOS_PORT,AL
	jmp	SHORT @F
@@:
	xchg	AH,AL
	out	CMOS_DATA,AL

	sti
	ret

WriteCmos ENDP

;---------------------------------------------------------------------------

END

⌨️ 快捷键说明

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