LEX 'TIMELEX' ID #5E last scratch, tokens 40>49 MSG 0 no message table POLL 0 no poll handler * * This Lex file Displays a running Clock on the LCD * Clock key word was written By John R Baker * Typed in by Bruce hobson on 1/19/85 * WINDST EQU #2F471 value of display window start BLDBIT EQU #019BC low level ASCII buffer to display COLON EQU #3A hex value of ':' ASRW4 EQU #0ED0D 4 ASR W MAINLP EQU #002FD main execution loop YMDHMS EQU #130DB returns current YYMMDDHHMMSS in C CK"ON" EQU #076AD checks if 'ON' key pressed BF2DSP EQU #01C0E sends bufer to display, SLOW ! FUNCR0 EQU #2F89B function scratch RAM, 42 nibs HEXASC EQU #17148 convert BCD hex digits to ASCII * ENTRY CLOKST entry to running clock CHAR #1 keyboard only * * * KEY 'CLOCK' displays a running clock TOKEN 40 ENDTXT * pCLOCK RTNCC * REL(5) pCLOCK CLOKST GOSBVL YMDHMS get current time P= 5 copy only HHMMSS not date A=C WP HHMMSS to A 5:0 P= 15 for following LC LCHEX 5 #-1 of hex digits to convert P= 0 for HEXASC GOSBVL HEXASC convert hex to ASCII LC(2) COLON ASCII of colon, ':' D1=(5) FUNCR0 point to function scratch DAT1=A 4 write seconds to scratch D1=D1+ 4 step over seconds GOSBVL ASRW4 shift to line up for minutes DAT1=C B write colon D1=D1+ 2 step over colon DAT1=A 4 write minutes D1=D1+ 4 step over minutes GOSBVL ASRW4 line up for hours DAT1=C B write colon D1=D1+ 2 step over colon DAT1=A 4 write hours C=0 W clean start P= 14 for LC LCHEX 7 #-1 of ASCII chars to write P= 0 for LC D=C W #-1 of chars in D 15:14 LC(5) FUNCR0 location of buffer in C(A) GOSBVL BLDBIT build display from bufer GOSBVL CK"ON" has 'ON' key been pressed ? GOC CLOKST no, then keep running GOVLNG MAINLP yes, then exit to main loop * * END end of lex file TIMELEX