📄 tmt.s
字号:
;/* FUNCTION */
;/* */
;/* TMT_Read_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* TMD_Timer Value of count-down timer */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 07-15-1993 Created initial version 1.0 */
;/* D. Lamie 07-15-1993 Verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Read_Timer
_TMT_Read_Timer:
;UNSIGNED TMT_Read_Timer(void)
;{
;
; /* Return the current value of the count-down timer. */
; return(TMD_Timer);
MOVE.L _TMD_Timer,D0 ; Pickup the current timer value
RTS ; Return to caller
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Enable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function enables the count-down timer with the specified */
;/* value. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* TMC_Timer_Task Timer expiration task */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 07-15-1993 Created initial version 1.0 */
;/* D. Lamie 07-15-1993 Verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Enable_Timer
_TMT_Enable_Timer:
;VOID TMT_Enable_Timer(UNSIGNED time)
;{
;
; /* Place the new time value into the count-down timer. */
; TMD_Timer = time;
;
MOVE.L 4(A7),_TMD_Timer ; Pickup the timer request value
;
; /* Indicate that the timer is active. */
; TMD_Timer_State = TM_ACTIVE;
;
CLR.L _TMD_Timer_State ; Activate the timer
RTS ; Return to caller
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Adjust_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function adjusts the count-down timer with the specified */
;/* value- if the new value is less than the current. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 03-01-1994 Created initial version 1.1 */
;/* D. Lamie 03-18-1994 Verified version 1.1 */
;/* */
;/*************************************************************************/
XDEF _TMT_Adjust_Timer
_TMT_Adjust_Timer:
;VOID TMT_Adjust_Timer(UNSIGNED time)
;{
;
; /* Lockout interrupts. */
;
ORI.W #LOCKOUT,SR ; Lockout interrupts
;
; /* See if new time value is less than current time value. */
; if (time < TMD_Timer)
;
MOVE.L 4(A7),D0 ; Pickup new value
CMP.L _TMD_Timer,D0 ; Compare it with current
BGE _TMT_No_Adjust ; If current is less, skip adjust
;
; /* Adjust timer. */
; TMD_Timer = time;
;
MOVE.L D0,_TMD_Timer ; Setup new timer value
;
_TMT_No_Adjust:
;
; /* Restore interrupt level. */
;
MOVE.W SR,D1 ; Pickup the SR
AND.W #$F8FF,D1 ; Clear interrupt level bits
OR.W _TCD_Interrupt_Level+2,D1 ; Or-in interrupt level
MOVE.W D1,SR ; Put new level in SR
;
; /* Return to caller. */
RTS ; Return to caller
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Disable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function disables the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* TMC_Timer_Task Timer expiration task */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 07-15-1993 Created initial version 1.0 */
;/* D. Lamie 07-15-1993 Verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Disable_Timer
_TMT_Disable_Timer:
;VOID TMT_Disable_Timer(void)
;{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -