tic42go.asm

来自「ADUC842 C程序集,包括ADC,DAC,PLL,PWM,WDT等程序.」· 汇编 代码 · 共 45 行

ASM
45
字号
;File: tic42go.a51
;Author: Eckart Hartmann Date:17/10/2003
;Development progress: Tic842.df
;
;TicGo==========Set and start timer.
;C Function prototype: char TicGo(char cHr, char cMin, char cSec, char cHth);
;Description of Function: Sets hour, minute, second and hundredths and starts TIC.
;User interface: Set the 4 parameters to the required time.
;		Call TicGo function.
;		TicGo sets the start time and starts the timer.
;		returns TIMECON (guaranteed not zero).
;Robustness:
;Side effects:
;
NAME TICGO
$NOMOD51
 $IC(..kei842.inc) ; Parameter passing registers for Keil .
 $IC(..kei842.dat) ; SFR definition for Keil .
;
public _TicGo, ?_TicGo?BYTE

?PR?_TicGo?TICGO	SEGMENT CODE
?DT?_TicGo?TICGO	SEGMENT DATA
	RSEG	?DT?_TicGo?TICGO
?_TicGo?BYTE:
cHr:	DS	3	;Space for first 3 parameters (not utilised).
cHth:	DS	1	;cHth parameter;	
;
	RSEG	?PR?_TicGo?TICGO
;
_TicGo:
	mov	HOUR,cP1l	;Set time.
	mov	MIN,cP2lc
	mov	SEC,cP3lcc
	mov	HTHSEC,cHth
	orl	TIMECON,#1	;Start TIC.
	mov	cP1l,TIMECON
	ret
;
;Function End==========================================================Function End
END



⌨️ 快捷键说明

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