Skip to navigation

Revs on the BBC Micro

Drivers: ZeroTimer

Name: ZeroTimer [Show more] Type: Subroutine Category: Drivers Summary: Zero the specified timer
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * AddTimeToTimer calls ZeroTimer * MainDrivingLoop (Part 1 of 5) calls ZeroTimer * ResetVariables calls ZeroTimer * UpdateLapTimers calls ZeroTimer

Arguments: X The timer to set to zero: * 0 = the clock timer (clockMinutes clockSeconds clockTenths) * 1 = the lap timer (lapMinutes lapSeconds lapTenths)
Returns: A A = 0 and the Z flag is set (so a BEQ will branch)
.ZeroTimer LDA #0 \ Zero clockTenths or lapTenths STA clockTenths,X STA clockSeconds,X \ Zero clockSeconds or lapSeconds STA clockMinutes,X \ Zero clockMinutes or lapMinutes RTS \ Return from the subroutine