Category : Forth Source Code
Archive   : FIFTH.ZIP
Filename : TIME.FIV

 
Output of file : TIME.FIV contained in archive : FIFTH.ZIP
CREATE X
CREATE TIME
EDIT
\ Returns the time in hundreths of a second.
16 base !
: time
\ es ds si di dx cx bx ax int
00000000 00000000 00000000 00002C00 21 int \ get time.
2drop swap drop swap drop \ get rid of bogusness
[ decimal ]
dup 16 shr swap 16 shl + \ Yields time in hour.min.sec.100th
dup 255 and \ Hundreths,
over 8 shr 255 and 100 * + \ Secs -> 100ths and add,
over 16 shr 255 and 100 * 60 * + \ Mins -> 100ths and add,
swap 24 shr 255 and 100 * 60 * 60 * + \ Hrs -> 100ths and add.
;
~UP
CREATE TIME_PRINT
EDIT
\ Prints the time in the format >>--> Hours:minutes:seconds:100ths
16 base !
: time_print
\ es ds si di dx cx bx ax int
00000000 00000000 00000000 00002C00 21 int \ get time.
2drop swap drop swap drop \ get rid of bogusness
[ decimal ]
dup 16 shr swap 16 shl +
<# dup 255 and # # drop 8 shr 58 hold
dup 255 and # # drop 8 shr 58 hold
dup 255 and # # drop 8 shr 58 hold
dup 255 and # # drop 8 shr
#> type
;
~UP
EDIT
~UP
ABORT


  3 Responses to “Category : Forth Source Code
Archive   : FIFTH.ZIP
Filename : TIME.FIV

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/