亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ptime.asm

?? DOS 源碼 系列之 BIOS ,上傳與大家分享
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;
;------------------------------------------------------------------------------
;M074 - ptime.asm added, containing clock/time routines for power.asm.
;
;   09/11/91  SMR	M077: B#2669. Registered POWER's 2f channels in mult.inc
;
;   09/25/91  NSM	M090: B#2729. Try to update our time from CMOS under 
;			WIN ENH mode once in 1024 I1c ticks. 
;			(approx. once in a minute)
;			This update happens only if DOS calls us for time and
;			does not exactly happen once in a minute.
;
;			(this is changed to 20 secs from 1 minute)
;
;  11/26/91   NSM	M101: We lose date sometimes under windows. To fix this
;			do Int 1a's to get tick count instead of looking at 40:
;			6ch and if we get rollover, then go & update date 
;			and time from CMOS.
;------------------------------------------------------------------------------
;
;

	.xlist

	include version.inc     ; set build flags

IFDEF   POWER			; generate code only if power management
				; is enabled

IFNDEF  POWERALONE              ; segment declarations for resident version

	include biosseg.inc     ; establish bios segment structure

ELSE                            ; segment declarations for standalonde version

.SEQ
Bios_Code       segment word public 'Bios_Code'
Bios_Code       ends

Bios_Data       segment word public 'Bios_Data'
Bios_Data       ends

SysInitSeg      segment word public 'system_init'
SysInitSeg      ends

; following segment definitions used by transient part of code

ENDIF

	include msequ.inc
	include devsym.inc
	include bpb.inc
	include ioctl.inc
	include	mult.inc		; M077
	include power.inc

IFDEF INCL_APM
	include	apmequ.inc		; M001
ENDIF

break   macro
	endm

	include error.inc
	.list
	

	include msgroup.inc     ; define Bios_Data segment

	extrn	month_table:word

IFDEF   POWERALONE                      ; standalone device driver version
Bios_Res        dw      Bios_Code       ; Our code segment address
ELSE                                    ; resident BIOS version
	extrn   Bios_Res:word           ; Code segment address supplied externally
	extrn	ttticks:dword		; far ptr to time_to_ticks routine
	extrn	bintobcd:dword		; ptr to bin_to_bcd routine

IFDEF	INCL_APM
	extrn	Check_and_Init_APM_Ptr:dword	; ptr to APM init routine
ENDIF	;INCL_APM

	extrn	P_UpdFromCMOS_Ptr:dword	; ptr to CMOS clock read	; M081

ENDIF	;NOT POWERALONE

	extrn	daycnt:word	; extrns for both resident and stand-alone
	extrn	daycnt2:word	; versions
	extrn	base_century:byte
	extrn	base_year:byte
	extrn	month_tab:byte
	extrn	bin_date_time:byte
	extrn	CMOSUpdFlg:byte
	extrn	CMOSPollCount:word

	tocode
IFDEF	POWERALONE			; stand alone version

Bios_Data_Word  dw      Bios_Data               ; Our data segment

bintobcd	proc	near	;for real time clock support

;convert a binary input in al (less than 63h or 99 decimal)
;into a bcd value in al.  ah destroyed.

	push	cx

	aam				; M048
	mov	cl, 4			; M048
	shl	ah, cl			; M048
	or	al, ah			; M048

	pop	cx
	ret

bintobcd	endp

ELSE				; resident version
	extrn	Bios_Data_word:word

ENDIF

	public	tim_read
	public	tim_writ
;--------------------------------------------------------------------
;
; tim_writ sets the current time
;
; on entry es:[di] has the current time:
;
;	number of days since 1-1-80	(word)
;	minutes (0-59)			(byte)
;	hours (0-23)			(byte)
;	hundredths of seconds (0-99)	(byte)
;	seconds (0-59)			(byte)
;
; each number has been checked for the correct range.
;
tim_writ proc	near
	assume	ds:Bios_Data
	mov	ax,word ptr es:[di]
	push	ax		;daycnt. we need to set this at the very
				;  end to avoid tick windows.

;	Set hardware clock time.

	mov	al,es:[di+3]		;get binary hours
	call	bintobcd		;convert to bcd
	mov	ch,al			;ch = bcd hours
	mov	al,es:[di+2]		;get binary minutes
	call	bintobcd		;convert to bcd
	mov	cl,al			;cl = bcd minutes
	mov	al,es:[di+5]		;get binary seconds
	call	bintobcd		;convert to bcd
	mov	dh,al			;dh = bcd seconds
	mov	dl,0			;dl = 0 (st) or 1 (dst)
	cli				;turn off timer
	mov	ah,03h			;set rtc time
	int	1ah			;call rom bios clock routine
	sti

	mov	cx,word ptr es:[di+2]
	mov	dx,word ptr es:[di+4]
IFDEF POWERALONE
	call	time_to_ticks			
ELSE
	call	ttticks
ENDIF
				;cx:dx now has time in ticks
	cli			; turn off timer
	mov	ah, 1		; command is set time in clock
	int	1ah		; call rom-bios clock routines
	pop	[daycnt]
	sti

	call	daycnttoday	; convert to bcd format
	cli			; turn off timer
	mov	ah,05h		; set rtc date
	int	1ah		; call rom-bios clock routines
	sti

	clc
	ret
tim_writ endp

;
; gettime reads date and time
; and returns the following information:

;	es:[di]  =count of days since 1-1-80
;	es:[di+2]=hours
;	es:[di+3]=minutes
;	es:[di+4]=seconds
;	es:[di+5]=hundredths of seconds

tim_read proc	near

; M090 BEGIN - See if we have to update our time from CMOS before 
; returning date and time to caller.

	cmp	[CMOSUpdFlg],0		; M090 do we need to update from CMOS
	je	tr_NoCMOSUpdate		; 

tr_CMOSUpd:				; M101
IFDEF	POWERALONE			; M081
	call	far ptr P_UpdFromCMOS
ELSE
	call    P_UpdFromCMOS_ptr   	; M074 update our date and time
					; from CMOS RTC
ENDIF
	mov	[CMOSPollCount],MAXCMOSPOLLCOUNT
	mov	[CMOSUpdFlg],0		; 
; M090 END

tr_NoCMOSUpdate:
; M101	- BEGIN - get tick count through 1a instead of looking at 40:6ch
; and check for rollover
	mov	ax,0			; get tick count
	int	1ah			; cx:dx = tick count	
	or	al,al			; al != 0 if midnight passed	
	jnz	tr_CMOSUpd		; rollover; update date and time
; M101	- END
	mov	si,[daycnt]

; we now need to convert the time in tick to the time in 100th of
; seconds.  the relation between tick and seconds is:
;
;		 65536 seconds
;	       ----------------
;		1,193,180 tick
;
; to get to 100th of second we need to multiply by 100. the equation is:
;
;	ticks from clock  * 65536 * 100
;      ---------------------------------  = time in 100th of seconds
;		1,193,180
;
; fortunately this fromula simplifies to:
;
;	ticks from clock * 5 * 65,536
;      --------------------------------- = time in 100th of seconds
;		59,659
;
; the calculation is done by first multipling tick by 5. next we divide by
; 59,659.  in this division we multiply by 65,536 by shifting the dividend
; my 16 bits to the left.
;
; start with ticks in cx:dx
; multiply by 5

	mov	ax,cx
	mov	bx,dx
	shl	dx,1
	rcl	cx,1		;times 2
	shl	dx,1
	rcl	cx,1		;times 4
	add	dx,bx
	adc	ax,cx		;times 5
	xchg	ax,dx		
	

; now have ticks * 5 in dx:ax
; we now need to multiply by 65,536 and divide by 59659 d.

	mov	cx,59659	; get divisor
	div	cx
				; dx now has remainder
				; ax has high word of final quotient
	mov	bx,ax		; put high work if safe place
	xor	ax,ax		; this is the multiply by 65536
	div	cx		; bx:ax now has time in 100th of seconds


;rounding based on the remainder may be added here
;the result in bx:ax is time in 1/100 second.

	mov	dx,bx
	mov	cx,200		;extract 1/100's

;division by 200 is necessary to ensure no overflow--max result
;is number of seconds in a day/2 = 43200.

	div	cx
	cmp	dl,100		;remainder over 100?
	jb	noadj
	sub	dl,100		;keep 1/100's less than 100
noadj:
	cmc			;if we subtracted 100, carry is now set
	mov	bl,dl		;save 1/100's

;to compensate for dividing by 200 instead of 100, we now multiply
;by two, shifting a one in if the remainder had exceeded 100.

	rcl	ax,1
	mov	dl,0
	rcl	dx,1
	mov	cx,60		;divide out seconds
	div	cx
	mov	bh,dl		;save the seconds
	div	cl		;break into hours and minutes
	xchg	al,ah

;time is now in ax:bx (hours, minutes, seconds, 1/100 sec)

	push	ax
	mov	ax,si		; daycnt
	stosw
	pop	ax
	stosw
	mov	ax,bx
	stosw
	clc
	ret

tim_read endp

	assume	es:nothing

; the following routine is executed at resume time when the system
; powered on after suspension. it reads the real time clock and
; resets the system time and date
;
; This can be patched to be the INT6C vector so that this can be
; used by other people to update DOS time from CMOS (after taking
; care for IRET)

	public	P_UpdFromCMOS
P_UpdFromCMOS	proc	far

	assume	ds:nothing
	push	ds
	mov	ds,cs:Bios_Data_Word
	assume ds:Bios_Data

	call	read_real_date		; get the date from the clock
PUFC_UpdDate:				; M101
	mov	ds:daycnt,si		; update our copy of date
	call	read_real_time		; get the time from the rtc
	cli
	mov	ah,01h			; command to set the time
	int	1ah			; call rom-bios time routine
	sti
; M101 BEGIN - check back to see if date changed when we were reading the
; time; if so, update date and time all over again ( Paranoid?)
	call	read_real_date		; get the date from the clock

; BUGBUG- nagara - Store the ret.value of date from int 1a in this
; procedure read_real_date so that at the end we don't really have to
; call read_real_date again; we just need to call int 1a and compare the
; date registers against the stored values of these registers.

	cmp	si,ds:daycnt		; is the date changed ?
	jne	PUFC_UpdDate		; yes, go back and set the new date
; M101 END
	pop	ds
	ret	

P_UpdFromCMOS	endp


;************************************************************************
;
;   read_real_date reads real-time clock for date and returns the number
;   of days elapsed since 1-1-80 in si
;
read_real_date proc near
	assume	ds:Bios_Data,es:nothing

	push	ax
	push	cx
	push	dx

	xor	ah,ah			; throw away clock roll over
	int	1ah

	pop	dx
	pop	cx
	pop	ax			; cas - bad code!

	push	ax
	push	bx
	push	cx
	push	dx

	mov	daycnt2,1	; real time clock error flag (+1 day)
	mov	ah,4		; read date function code
	int	1ah		; read real-time clock
	jnc	read_ok 	; jmp success
	jmp	r_d_ret 	; jmp error

read_ok:			; ******* get bcd values in binary *****
	mov	word ptr bin_date_time+0,cx  ; store as hex value
	mov	word ptr bin_date_time+2,dx  ; ...

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人与z0zoxxxx视频| av爱爱亚洲一区| 《视频一区视频二区| 久久综合国产精品| 日韩你懂的在线播放| 欧美一级欧美三级在线观看| 精品视频色一区| 欧美日本在线看| 制服视频三区第一页精品| 欧美日韩国产另类一区| 欧美群妇大交群中文字幕| 9191成人精品久久| 日韩一区二区三区视频| 精品国产一区二区精华| 久久一日本道色综合| 欧美激情综合五月色丁香| 国产欧美一区二区三区网站| 国产欧美1区2区3区| 国产精品美女一区二区三区| 中文字幕中文字幕一区| 亚洲情趣在线观看| 五月天欧美精品| 精品系列免费在线观看| 丰满亚洲少妇av| 91国产丝袜在线播放| 6080午夜不卡| 国产日韩欧美激情| 亚洲影院理伦片| 精品一区二区免费在线观看| 粉嫩aⅴ一区二区三区四区| 色综合视频在线观看| 欧美一区二区在线播放| 久久久久国产精品麻豆| 亚洲欧美日韩一区二区 | 久久综合九色综合97婷婷| 久久精品欧美一区二区三区不卡| 国产精品国产自产拍高清av| 一级做a爱片久久| 国内精品视频666| 日本道免费精品一区二区三区| 91精品综合久久久久久| 国产精品美女久久久久久久网站| 亚洲超丰满肉感bbw| 国产成人精品影院| 欧美日韩成人综合| 亚洲欧美在线视频观看| 经典三级在线一区| 色琪琪一区二区三区亚洲区| 精品毛片乱码1区2区3区| 亚洲自拍偷拍九九九| 国产99一区视频免费| 欧美久久免费观看| 国产精品女主播av| 国产精品系列在线观看| 91精品国产91热久久久做人人 | 成人av中文字幕| 欧美一区二区三区人| 一区在线播放视频| 国产福利电影一区二区三区| 欧美色综合天天久久综合精品| 国产日韩欧美激情| 国产一区二区三区在线观看免费| 欧美日韩和欧美的一区二区| 最新日韩在线视频| 成人深夜视频在线观看| 久久天天做天天爱综合色| 水野朝阳av一区二区三区| 91成人免费在线视频| 国产精品国产三级国产aⅴ中文| 国产乱理伦片在线观看夜一区| 欧美二区三区的天堂| 亚洲午夜免费福利视频| 色8久久精品久久久久久蜜| 国产精品婷婷午夜在线观看| 精品在线你懂的| 欧美α欧美αv大片| 免费观看91视频大全| 欧美一级专区免费大片| 美女视频黄免费的久久 | 国产精品麻豆网站| 国产suv精品一区二区883| 精品国产亚洲在线| 国内精品伊人久久久久影院对白| 精品国产乱码久久久久久久| 久久国产欧美日韩精品| 精品99久久久久久| 国产精品一区在线观看你懂的| 国产人成亚洲第一网站在线播放 | 亚洲国产精品精华液ab| 国产91精品精华液一区二区三区| 久久久精品日韩欧美| 本田岬高潮一区二区三区| 亚洲欧美日韩国产中文在线| 色欧美日韩亚洲| 日本不卡123| 国产欧美一区二区三区沐欲| 成人av资源站| 亚洲高清视频的网址| 日韩三级中文字幕| 波多野洁衣一区| 亚洲国产视频a| 精品日本一线二线三线不卡| 国产盗摄一区二区| 亚洲综合在线电影| 欧美电视剧在线看免费| 成人aa视频在线观看| 性做久久久久久免费观看欧美| 欧美刺激脚交jootjob| 成人国产精品免费观看动漫| 一区二区成人在线视频| 日韩三级电影网址| 97精品久久久午夜一区二区三区 | 色婷婷综合久久| 日本系列欧美系列| 国产精品久久一级| 欧美理论片在线| 成人久久视频在线观看| 午夜视频在线观看一区二区三区| www国产精品av| 在线亚洲高清视频| 国产乱人伦偷精品视频免下载| 亚洲欧美日韩国产中文在线| 精品久久99ma| 欧美日韩激情一区二区| av在线不卡电影| 麻豆高清免费国产一区| 一区二区三区在线观看欧美| 久久综合九色综合久久久精品综合| 日本二三区不卡| 国产精品亚洲专一区二区三区 | 欧美一区二区三区免费大片 | 精品写真视频在线观看| 亚洲女同一区二区| 亚洲国产精品国自产拍av| 欧美一级黄色录像| 欧美私人免费视频| 99精品视频一区二区三区| 国模冰冰炮一区二区| 日韩有码一区二区三区| 亚洲最大成人综合| 亚洲免费资源在线播放| 中文一区一区三区高中清不卡| 欧美大胆人体bbbb| 91精品国产高清一区二区三区| 欧美亚洲免费在线一区| 日本高清不卡视频| 91麻豆123| 91国偷自产一区二区三区观看| av一二三不卡影片| 白白色亚洲国产精品| 懂色av一区二区三区免费观看 | 欧美国产日韩一二三区| 欧美大尺度电影在线| 日韩一级免费观看| 日韩精品最新网址| 精品国产乱码久久| 2020国产精品| 久久精品亚洲精品国产欧美kt∨| 欧美变态口味重另类| 2欧美一区二区三区在线观看视频| 精品欧美一区二区三区精品久久 | 91美女片黄在线观看| 99久久国产免费看| 91最新地址在线播放| 日本韩国欧美国产| 91精品在线观看入口| 日韩欧美中文一区| 久久精品一区二区| 综合激情网...| 亚洲精品第一国产综合野| 亚洲动漫第一页| 午夜激情综合网| 蜜桃视频一区二区三区在线观看| 麻豆专区一区二区三区四区五区| 经典三级在线一区| 9i看片成人免费高清| 欧美中文字幕一二三区视频| 欧美亚洲一区三区| 精品99999| 亚洲天堂中文字幕| 日本午夜一本久久久综合| 国产一区二区三区免费观看| 波多野结衣在线一区| 在线看国产一区二区| 日韩欧美电影在线| 亚洲图片另类小说| 日韩在线卡一卡二| 成人动漫视频在线| 欧美日韩一区久久| 国产日韩影视精品| 香蕉乱码成人久久天堂爱免费| 久久99精品久久只有精品| 99r精品视频| 7777精品伊人久久久大香线蕉的 | 欧美视频第二页| 久久久精品人体av艺术| 亚洲高清免费在线| 99精品国产一区二区三区不卡 | 美日韩黄色大片| 91丨国产丨九色丨pron|