; set seconds to 0 and round off minutes to nearest
; but ignore if minutes will exceed 0-59 to avoid calendar rollovers
Symbol ij = w20 ; loop and counter indices
Symbol i = b40 ; and other temporary values
Symbol j = b41 ; of short life in routines
Symbol kl = w21
Symbol k = b42
Symbol l = b43
zero_seconds:
hi2cin 0,(i,j) ; get clock seconds and minutes
k = BCDtoBIN i
l = BCDtoBIN j
If k > 29 AND l < 59 Then
i = 0
inc l
j = BINtoBCD l
hi2cout 0,(i, j) ; update clock
Else if K < 30 Then ; round down, no minute adjust
i = 0
hi2cout 0,(i)
EndIf
Return