Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:06 07 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : TIMER Documentation Disagreement

Author Message
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 11:31am 23 Jul 2016
Copy link to clipboard 
Print this post

Hi guys, it's that Polack from NY with another dumb syntax question.

The Micromite Manual.pdf says
  Quote  TIMER Returns the elapsed time in milliseconds (eg, 1/1000 of a second) since reset. The timer is reset to zero on power up or a CPU restart and you can also
reset by using TIMER as a command. If not specifically reset it will continue to count up forever (it is a 64 bit number and will only roll over to zero after 200 million years).

200 million years is 6.3072E+18 ms.
A 64 bit binary could count to 1.8447E+19 ms.

But the MMBasic Language Manual.pdf says
  Quote   TIMER CMM MM DOS Returns the elapsed time in milliseconds (eg, 1/1000 of a second) since reset. If not specifically reset this count will wrap around to zero after 49 days. The timer is reset to zero on power up and you can also reset by using
TIMER as a command.

49 days is 4.2336E+09 ms.
A 32 bit binary could count to 4.2950E+09 ms.

Which seems to indicate that it was changed from 64 bits to 32 bits sometime.

The Micromite Plus manual is silent on the matter.

So, which version of MMBasic and which chips use 64 bits and which use 32 bits?

Paul
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 01:54pm 23 Jul 2016
Copy link to clipboard 
Print this post

The colour maximite V4.5 uses 32 bit. Al numbers are floating piont so while the internal counter rolls over every 49 days, the usable count is less and you would need to do your own overflow code.

The later micromites had 64 bit integers added to the mix. This makes life easier.

Jim


VK7JH
MMedit
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025