revamping datetime draft

This commit is contained in:
Luxferre
2022-07-31 10:25:53 +03:00
parent 626b31bb4b
commit f2bad1455f
3 changed files with 56 additions and 14 deletions
+17 -2
View File
@@ -142,12 +142,27 @@ ID |Params |Command|Meaning
`03` |1s 3b [addr addr]|`a3` |Read a byte under the 3-byte flash address
`04` |1b 3b [page addr]|`84` |Write a page under the 3-byte flash address
`05` |1b 3b [page addr]|`85` |Read a page under the 3-byte flash address
`06` |1s [addr] |`46` |Read the current system time/date information (5 bytes/40 bits, Unix time) into the address
`07` |1s [addr] |`47` |Set the current system time/date information (5 bytes/40 bits, Unix time) from the address
`06` |1s [addr] |`46` |Read the current system time/date information (see below) into the address
`07` |1s [addr] |`47` |Set the current system time/date information (see below) from the address
`08-1d`| | |(reserved)
`1e` |1b 3b [flag addr]|`9e` |Load and run another Uxn/ESOP application from flash address according to the flags
`1f` |None |`1f` |Halt (required)
### Datetime syscall implementation notes
The `46` and `47` calls, where implemented, should operate on 10 bytes of memory addressed by the value passed to them.
The layout of these 10 bytes is similar to the one defined in Uxn/Varvara and Uxn/SPARTA specs:
- `00-01`: year
- `02`: month
- `03`: day
- `04`: hour
- `05`: minute
- `06`: second
- `07`: day of the week
- `08-09`: day of the year
- `0a`: DST flag for the local time
## Credits
Spec and reference implementation developed by Luxferre in 2022, released into the public domain.