This is a great thread, because it's demonstrating and reminding us of a whole heap of things... and these are useful things...
So far...
1. We've been reminded of a little known but very useful variable called R2 in the DIV32 command.
2. We've manipulated a 32 bit variable which on the face of it seemed impossible with PBP, and reduced it to something useful and manageable.
3. We've converted Gregorian Date (DAY, MONTH, YEAR) into a Julian Date (Linear DAYS).
4. We've converted Julian Date (Linear DAYS) back into a Gregorian Date (DAY, MONTH, YEAR). This has been mentioned you can't do it with only 16-bit variables.
5. We've discovered a way of saving a Date (as DAY, MONTH and YEAR) compactly as two BYTES (great for space saving when Data-Logging).
6. Better than that we've discoverd a way to save DAY, MONTH, YEAR, HOUR, MINUTE and SECOND, as only FOUR bytes. Again, beat that for a Data-Logging application.
Just using those you could enter two dates, and not only determine the DAYS between them, but you could determine it to the SECOND.
7. We've demonstrated a method of 16 by 17 bit multiplication... to produce a 32 Bit result.
And we've done it all in 'pure' PBP with no Assembler or other 'bought-in' foreign routines. That way, everybody can follow it and learn something to their benefit.
And this thread isn't done yet...
Bookmarks