Henrik,
No worries on the simulation testing. It's fairly easy as you know using MPLAB Simulator.
The tools are all there for the using.
- The ability to setup a PBP project directly in MPLAB so you can edit the PBP source, recompile.
- Set the breakpoints you want.
- The beauty though for this kind of testing is really the Stopwatch feature!
Couple Stopwatch with breakpoints (either PBP source or ASM), it's great.
Yes, my wording regarding the computationally intensive nature of division was perhaps inadequate.
My statement about Division in general being "instruction intensive" was my indirect referral to the iterative subtraction routine required.
By stating that DIV32 "only makes matters worse", was the fact that the division process (iterative subtraction routine) is now exacerbated by a larger dividend (31bit number).
Again, not the best choice of words.
On the surface your new routine does indeed look like it will drastically reduces the number of instructions, great thoughts.
When I get a few minutes I will give the new code a simulation run through and provide back the results.
Thanks,
Bookmarks