Sunday, September 20, 2009

I've started working on a 32-bit math library. I wanted to get an "uptime" command working, but to do this, I needed this library. I've done some tests with the DIV command, and confirmed that it will cause an overflow if the resulting value will not fit in a 16-bit value.

I've got 32-bit addition, subtraction, compare, right and left shifts. I still need to get division working. I think the existing 16x16 MPY command will be OK, but as I type this I can see cases where a 32x16 routine would be handy. I can't see any reason for a 32x32 routine, since all results will exceed 32 bits. If some wierd case pops up which needs this, I can do this work later.

No comments:

Post a Comment