A2osX/SYS/KERNEL.S.TIME.txt
2020-01-21 08:34:32 +01:00

92 lines
2.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*/--------------------------------------
* # Time
* Get System Time in Buffer
* ## C
* `int time (S.TIME* timer);`
* ## ASM
* `>PUSHW timer`
* `>SYSCALL time`
* ## RETURN VALUE
* S.TIME filled with System date/time
*\--------------------------------------
K.Time >PULLW FORPNT
>MLICALL MLIGETTIME
>LDYAI DATELO
>STYA TXTPTR
ldx #SYS.PTime2Time
bra TIME.JMP
*/--------------------------------------
* # StrFTime
* ## C
* Convert S.TIME struct to CSTR
* `void strftime (char* ptr, const char* format, const struct S.TIME* timeptr );`
* ## ASM
* `>PUSHW ptr`
* `>PUSHW format`
* + %a : Abbreviated weekday name : Thu
* + %A : Full weekday name : Thursday
* + %b : Abbreviated month name : Aug
* + %B : Full month name : August
* + %d : Day of the month, zero-padded (01-31)
* + %H : Hour in 24h format (00-23) 14
* + %I : Hour in 12h format (01-12) 02
* + %m : Month as a decimal number (01-12) 08
* + %M : Minute (00-59) 55
* + %p : AM or PM designation PM
* + %S : Second (00-61) 02
* + %w : Weekday as a decimal number with Sunday as 0 (0-6)
* + %y : Year, last two digits (00-99)
* + %Y : Year four digits 2001
* `>PUSHW timeptr`
* `>SYSCALL strftime`
* ## RETURN VALUE
* none. always succeed.
*\--------------------------------------
K.StrFTime >PULLW ZPPtr1 timeptr
*/--------------------------------------
* # PTime2Time
* Convert ProDOS Time To S.TIME
* ## C
* `int PTime2Time (long* ptime, S.TIME* timer);`
* ## ASM
* `>PUSHW ptime`
* `>PUSHW timer`
* `>SYSCALL PTime2Time`
* ## RETURN VALUE
*\--------------------------------------
K.PTime2Time
*/--------------------------------------
* # CTime2Time
* Convert CTime Time To S.TIME
* ## C
* `int CTime2Time (long* ctime, S.TIME* timer);`
* ## ASM
* `>PUSHW ctime`
* `>PUSHW timer`
* `>SYSCALL CTime2Time`
* ## RETURN VALUE
*\--------------------------------------
K.CTime2Time >PULLW FORPNT
>PULLW TXTPTR
TIME.JMP sta SETREADAUX
sta SETWRITEAUX
jsr .1
sta CLRREADAUX
sta CLRWRITEAUX
rts
.1 jmp (.2-SYS.StrFTime,x)
.2 .DA K.StrFTime.I
.DA K.PTime2Time.I
.DA K.CTime2Time.I
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.TIME
LOAD USR/SRC/SYS/KERNEL.S
ASM