[nos-bbs] Update - Timer issues in JNOS

Maiko Langelaar maiko at pcs.mb.ca
Wed Aug 4 14:45:08 EDT 2010


Skip,

> it seems to me that DOS users have not chimed in ...

Funny you mention DOS, the code (pc.c) CLEARLY talks about 24.85 days
before the timer stuff goes 'negative'. The repair for it was to use
the longmul() and longdiv() functions for DOS only.

      /* old way: return Clock * MSPTICK / 1000L; */
      /* new way: We use longmul() and longdiv() routines since
       * Clock * MSPTICK exceeds 2^31 in about 24.85 days and
       * becomes negative. And, we also get better accuracy.  (Selcuk)
       */

BUT, I think they would have found that the timers would have gone haywire
anyways even with that fix, but perhaps sometime after 50 days or so.

         /* old way: return Clock * MSPTICK / 1000L; */
         /* new way: We use longmul() and longdiv() routines since
          * Clock * MSPTICK exceeds 2^31 in about 24.85 days and
          * becomes negative. And, we also get better accuracy.  (Selcuk)


Would be interesting if any DOS users (or Barry) can comment on that.

Maiko Langelaar / VE4KLM






More information about the nos-bbs mailing list