Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on June 01, 2018, 05:14:26 PM

Title: Casting a DINT as unsigned
Post by: Controls Guy on June 01, 2018, 05:14:26 PM
I'm counting scans and I don't want the counter to roll over negative, but DMD won't let me cast DST0:U, D0:U, etc.
Title: Re: Casting a DINT as unsigned
Post by: BobO on June 01, 2018, 08:49:29 PM
I'm counting scans and I don't want the counter to roll over negative, but DMD won't let me cast DST0:U, D0:U, etc.

Math stack does not support 32 bit unsigned. It was a trade-off.
Title: Re: Casting a DINT as unsigned
Post by: LWgreys on June 02, 2018, 01:47:58 AM
This is what I use as a 32-bit counter. Of corse my totalizer is actually 64-bit.