Time
This code snippet copies the time into L1;
Order: Seconds, Minutes, Hours

Assembly:

Code:
#include    "ti83plus.inc"
    bcall($515B) ; TI-OS getTime function (stores on the floating point stack)
    bcall(_PopRealO1) ; Pop a real from the FPS to OP1
    bcall(_ConvOP1) ; Convert OP1 to DE registers (and A LSB)
    ld (saveSScreen),de ; Load the contents of DE into {L1}
    bcall(_PopRealO1) ; Pop a real from the FPS to OP1
    bcall(_ConvOP1) ; Convert OP1 to DE registers (and A LSB)
    ld (saveSScreen + 1),de ; Load the contents of DE into {L1}
    bcall(_PopRealO1) ; Pop a real from the FPS to OP1
    bcall(_ConvOP1) ; Convert OP1 to DE registers (and A LSB)
    ld (saveSScreen + 2),de ; Load the contents of DE into {L1}


Axe:

Code:
Asm(EF5B51EF9043EFEF4AED53EC86EF9043EFEF4AED53ED86EF9043EFEF4AED53EE86)



Date
This code snippet copies the time into L1;
Order: Day, Month, (Year?)

Assembly:

Code:
#include    "ti83plus.inc"
    bcall($514F) ; TI-OS getDate function (stores on the floating point stack)
    bcall(_PopRealO1) ; Pop a real from the FPS to OP1
    bcall(_ConvOP1) ; Convert OP1 to DE registers (and A LSB)
    ld (saveSScreen),de ; Load the contents of DE into {L1}
    bcall(_PopRealO1) ; Pop a real from the FPS to OP1
    bcall(_ConvOP1) ; Convert OP1 to DE registers (and A LSB)
    ld (saveSScreen + 1),de ; Load the contents of DE into {L1}
    bcall(_PopRealO1) ; Pop a real from the FPS to OP1
    bcall(_ConvOP1) ; Convert OP1 to DE registers (and A LSB)
    ld (saveSScreen + 2),de ; Load the contents of DE into {L1}


Axe:

Code:
Asm(EF4F51EF9043EFEF4AED53EC86EF9043EFEF4AED53ED86EF9043EFEF4AED53EE86)



Licence
Name me in the credits or the readme if you want. I'd be happy if you do so, but its really optional. The code is without any warranty. Use it at your own risk.
You use ports 45h through 48h to read the current value of the clock, ports 41h through 44h to set the current value of the clock, and port 40h to turn the clock on and off. With these porst, you can get the clock value to within an accuracy of one second. If you need a more precise timer, you should consider looking at the crystal timers, but note that the TI-83 Plus does not offer these ports.
If you want a routine that just gets the string of data of the current time, I might look at this: http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:515E. Of course, reading from the ports works as well, but this might simplify things...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement