Author Topic: At what memory address(es) is system time stored on TI84?  (Read 4413 times)

0 Members and 1 Guest are viewing this topic.

Offline Waave

  • LV2 Member (Next: 40)
  • **
  • Posts: 22
  • Rating: +2/-0
    • View Profile
At what memory address(es) is system time stored on TI84?
« on: August 31, 2011, 07:59:01 pm »
I made a simple clock app using axe. I have everything working but the functions which get time, right now they are just placeholders which increase the time indefinitely.  I think I can get the time by reading from the memory address where the OS stores time, but I don't know what address that is.  If anyone knows it (them), could you tell me?  If you don't know, do you know a way I could find out?  If this method WILL NOT work, that would also be useful to know ;)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: At what memory address(es) is system time stored on TI84?
« Reply #1 on: August 31, 2011, 08:24:25 pm »
Actually, the timer has to be read via ports (to my knowledge). The ports to read are 45h, 46h, 47h, and 48h (I think 48h is one...)

However, this might get tricky since this would have to be done in 32-bits. If you want just a simple timer, you can do something like this:

Code: [Select]
Asm(EB0E45ED680CED60ED52
The way this will work is that you can run this once with a 0 on the previous line and store the result to a variable. This will be an offset that can be used later. When you run this again, later, make sure the variable with the offset is on the line before. This will then output the number of seconds that have passed since it was used the first time. Um, here is an example:
Code: [Select]
0
Asm(EB0E45ED680CED60ED52      ;Stores the current timer state to Ans
→T
<<code>>
T                             ;T will be subtracted from the current timer state
Asm(EB0E45ED680CED60ED52      ;Ans will be the number of seconds (up to 65535) since the timer was initially tested

I don't know if this helps...?

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: At what memory address(es) is system time stored on TI84?
« Reply #2 on: August 31, 2011, 09:11:01 pm »
Indeed, that clock is read by reading ports 45-48. This 32 bit number represents the number of seconds that have passed since midnight on January 1st, 1997.

Code: [Select]
ld hl, op1
ld bc, 4*256+$44
loop:
inc c
ini
jr nz, loop

Code: [Select]
21 78 84 01 45 04 0C ED A2 20 FB

After running this, the current time will be at $8478, (you can change the 78 84 in the hex to whatever you want :D)
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Waave

  • LV2 Member (Next: 40)
  • **
  • Posts: 22
  • Rating: +2/-0
    • View Profile
Re: At what memory address(es) is system time stored on TI84?
« Reply #3 on: September 01, 2011, 08:25:30 am »
Sounds good, but any help on how to access that number? (I'm using Axe Parser)

Also, the time will be in seconds, correct?