LEX 'KEYSLEEP' TITLE Key Sleep LEX, disassembled by Sam Chau [242] *********************************************************** * CON(2) #52 LEX ID# 52, Users' Library CON(2) 43 lowest token number CON(2) 43 highest token number CON(5) 0 no linked files NIBHEX F no speed table REL(4) (TxTbSt)+1 offset to TEXT table CON(4) 0 no message table CON(5) 0 no poll handler * ******************* EQUATES ***************************** * ALMSRV EQU #1257D check for pending alarms CKSREQ EQU #00721 handle service requests KEY$ EQU #1ACA8 mainframe KEY$ function SLEEP EQU #006C2 scan keybd, LSLEEP if key buffer empty * ******************* MAIN TABLE ************************* * CON(3) (TxEn01)-(TxTbSt) offset to Keyword REL(5) KYSLPx offset to execution code NIBHEX F a function, returning a string * ******************* TEXT TABLE ************************* * TxTbSt TxEn01 CON(1) (TxTbTm)-(TxEn01)-4 length of ASCII NIBASC 'KEYSLP$' CON(2) 43 token 43 decimal * TxTbTm NIBHEX 1FF end of TEXT table * ******************* Execution Code ********************** NIBHEX 00 no input arguments * KYSLPx CD0EX R0=C save copy of PC in R0 CD1EX R1=C save copy of SP into R1 RENTER GOSBVL SLEEP go to low power mode w/ keybd active GOC SERVCE wakeup: carry set = no key in buffer REWAIT C=R1 D1=C restore SP from R1 C=R0 D0=C restore PC from R0 GOVLNG KEY$ jump into mainfram KEY$ code SERVCE ?ST=0 13 program not running? GOYES SERVC2 yes, skip alarm service routine GOSBVL ALMSRV check for pending alarms GOC REWAIT carry set = clock timed out: sleep SERVC2 GOSBVL CKSREQ handle service requests GOTO RENTER go back to sleep * END