Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Slightly OT -- Fast Divide By 10

2004-11-30 by James Dabbs

I'm trying to squeeze a few more cycles out of one my LPC, and I'm
looking for an optimized way to divide by 10 and leave the quotient and
remainder.  I.e., a faster way to do this:

#define DIVIDE_BY_10(D, Q, R) Q=D/10; R=D%10;  // D is unsigned long

[It's to support a prehistoric data collection system, writing LOTS of
BCD ASCII data to a SRAM cartridge.]

Any info would be appreciated.

Thanks.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.