Split centisecond time into hours/minutes/seconds ================================================= mdfs.net/Info/Comp/6502/ProgTips/Date/Divide60 -- J.G.Harston This is the code I use to repeatedly divide a centisecond time to get hours, minutes, and seconds. It is a simple repeated-subtraction loop. \ Divide time in workspace by AYX \ On entry, AYX=divisor \ ws+0/1/2 = centisecond time \ On exit, A=result \ ws+0/1/2=remainder \ X=corrupted \ .RTCDivide0 LDA #0 .RTCDivide STX ws+5:STY ws+6:STA ws+7 LDX #255:SEC .RTCDivideLp LDA ws+0:SBC ws+5:STA ws+0 LDA ws+1:SBC ws+6:STA ws+1 LDA ws+2:SBC ws+7:STA ws+2 INX:BCS RTCDivideLp LDA ws+0:ADC ws+5:STA ws+0 LDA ws+1:ADC ws+6:STA ws+1 LDA ws+2:ADC ws+7:STA ws+2 TXA:RTS It is called this way: \ Place centisecond count in ws+0/1/2 LDA #&05:LDY #&7E:LDX #&40:JSR RTCDivide :\ Hours, TIME DIV (60*60*100) STA hours LDY #&17:LDX #&70:JSR RTCDivide0 :\ Minutes, remainder DIV (60*100) STA minutes LDY #&00:LDX #&64:JSR RTCDivide0 :\ Seconds, remainder DIV 100 STA seconds LDA ws+0 :\ Remainder is now centiseconds STA centi