The timer works like a clock. when seconds roll over from 59 it will go to 00 and minutes will advance. There is no hundreds position in the seconds.
The timer works like a clock. when seconds roll over from 59 it will go to 00 and minutes will advance. There is no hundreds position in the seconds.
Shawn
Hmm, yes. But it must be possible for it to continue instead of rolling over. This is what I altered in Melanies code to do this, however that was all PBP and no assembler.
That's where I'm lost. The code in Elapsed_INT I'm sure can be modified to continue counting the seconds into the seconds byte without a rollover, but where in the code?
You can modify the "Elapsed_INT.bas". If you open this file you will see some pbp code at "ClockCount:" . You can change the if statements for Hours, minutes, and seconds. Or you can add another varible and maintain the original code. I added the code in bold. Hope it helps.
Code:seconds2 var word 'place in main code ClockCount: @ RELOAD_TIMER ; Reload TIMER1 Ticks = Ticks + 1 if Ticks = 100 then Ticks = Ticks-100 Seconds = Seconds + 1 SecondsChanged = 1 seconds2 = seconds2 + 1 If seconds2 = 500 then ' Rollover at 500 seconds seconds2= 0 if Seconds = 60 then Minutes = Minutes + 1 MinutesChanged = 1 Seconds = 0 endif if Minutes = 60 then Hours = Hours + 1 HoursChanged = 1 Minutes = 0 endif if Hours = 24 then Days = Days + 1 DaysChanged = 1 Hours = 0 endif endif @ INT_RETURN ; Restore context and return from
Last edited by mark_s; - 10th January 2012 at 22:21.
Hi Mark,
Many thanks, I was just logging in to report what an idiot I am and to say it all works.
I had done all that and more but it still refused to work.
Doh, turns out I was altering a spare copy of Elapsed_INT in another folder !!!
I'm going to turn on the MCS option to show the full path so in future i won't make the same mistake again.
Bookmarks