### Author Topic: 84+/SE System Clock?  (Read 6073 times)

0 Members and 1 Guest are viewing this topic.

#### FloppusMaximus

• Posts: 290
• Rating: +57/-5
##### Re: 84+/SE System Clock?
« Reply #15 on: January 29, 2011, 12:08:22 am »
Well, if you're only interested in the time of day (not the date), that's relatively easy.  Doing it in pure Axe, using only 16-bit math, would be interesting and difficult, but the boot code provides an undocumented routine that you can use to divide a 32-bit number by a 16-bit number.  Something like this (untested):
Code: [Select]
Asm(217884  ; ld hl, OP1014904  ; ld bc, $04490D ; dec cEDA2 ; ini20FB ; jr nz,$ - 5113C00  ; ld de, 60EFB180  ; B_CALL Div32ByDE){e8486}→S ; number of secondsAsm(113C00  ; ld de, 60EFB180  ; B_CALL Div32ByDE){e8486}→M ; number of minutesAsm(111800  ; ld de, 24EFB180  ; B_CALL Div32ByDE){e8486}→H ; number of hourswould obtain the hours, minutes, and seconds since midnight; I'll let somebody else figure out how to turn that into a string.

#### ferox

• LV3 Member (Next: 100)
• Posts: 94
• Rating: +3/-0
##### Re: 84+/SE System Clock?
« Reply #16 on: January 31, 2011, 12:31:18 am »
Im trying to do something like the Basic GetTimeStr(12)

i do know a BASIC syntax for this:

Code: [Select]
getTime->L1
this stores the hours into L1(1) mins into L1(2) and secs into L1(3)
btw, it only knows 24 hours, no AM or PM display
« Last Edit: January 31, 2011, 12:32:23 am by ferox »
on hold:

#### calcdude84se

• Needs Motivation
• LV11 Super Veteran (Next: 3000)
• Posts: 2272
• Rating: +78/-13
• Wondering where their free time went...
##### Re: 84+/SE System Clock?
« Reply #17 on: February 01, 2011, 08:40:33 pm »
Sadly, he's looking for Axe code. That'd work for BASIC, though
Floppus, nice! Didn't know about that bcall
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
I'll put it online when it does something.

#### thepenguin77

• z80 Assembly Master
• LV10 31337 u53r (Next: 2000)
• Posts: 1591
• Rating: +823/-5
• The game in my avatar is bit.ly/p0zPWu
##### Re: 84+/SE System Clock?
« Reply #18 on: February 01, 2011, 08:54:07 pm »
i do know a BASIC syntax for this:

Code: [Select]
getTime->L1

And just like almost every basic command, it has a bcall counter part. bcall(_getTime) puts seconds, minutes, and hours all on the floating point stack. The method of retrieval can vary, but there are two distinct strategies. Pop and grab each one through op1, or pop them consecutively into op1 2 and 3.

So, method 1:
Code: [Select]
EF5B51 EF9043 grab OP1 seconds EF9043 grab OP1 minutes EF9043 grab OP1 hoursAnd method 2:
Code: [Select]
EF5B51 EF9043 EF8D43 EF8A43 OP1 = secs OP2 = minutes OP3 = hours

Just remember that those answers are TI floating point. So you'll have to convert them.

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

#### calcdude84se

• Needs Motivation
• LV11 Super Veteran (Next: 3000)
• Posts: 2272
• Rating: +78/-13
• Wondering where their free time went...
##### Re: 84+/SE System Clock?
« Reply #19 on: February 01, 2011, 09:00:09 pm »
Axe has float{ for that (converting from TI FP), so your method will work too
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."