retroforth/interface/clock.retro
crc cd47df06c9 interfaces/clock: reduce size of clock:operation
FossilOrigin-Name: abb9e847ac79f6f8f1782afed5b85030984d4f5db0389932556fe21e1ce96f2b
2021-04-19 17:32:15 +00:00

25 lines
803 B
Forth

# Time and Date
The `clock:` namespace contains words for interacting with the
system clock.
~~~
:clock:operation
#5 io:scan-for
dup n:negative? [ drop 'Error:_device_(0005)_not_found s:put nl ] if;
io:invoke ;
:clock:timestamp (-n) #0 clock:operation ;
:clock:day (-n) #1 clock:operation ;
:clock:month (-n) #2 clock:operation ;
:clock:year (-n) #3 clock:operation ;
:clock:hour (-n) #4 clock:operation ;
:clock:minute (-n) #5 clock:operation ;
:clock:second (-n) #6 clock:operation ;
:clock:utc:day (-n) #7 clock:operation ;
:clock:utc:month (-n) #8 clock:operation ;
:clock:utc:year (-n) #9 clock:operation ;
:clock:utc:hour (-n) #10 clock:operation ;
:clock:utc:minute (-n) #11 clock:operation ;
:clock:utc:second (-n) #12 clock:operation ;
~~~