LEX 'GREETLEX' * A file for polite HP71's. ID #EE * Jack Elhay, 29/6/88, PPPM. MSG MSGTBL * message table offset POLL 0 * no POLHND, but HELLO$ issues a poll. ENTRY HELLOF * entry for the function CHAR #F * function characterisation nibble ENTRY HELLOD * entry for the statement CHAR #D * use anywhere statement KEY 'HELLO$' * Syntax: HELLO$ (eg DISP HELLO$&" "&DATE$) TOKEN 1 * parameterless function KEY 'HELLO' * Syntax: HELLO (nearly same as DISP HELLO$) TOKEN 2 * parameterless statement ENDTXT TRUNCC EQU #12B4A * truncate 15-form to 12-form w/o rounding STD0D1 EQU #12A5C * store D0,D1 in R4(14,5), although unsupported * this entry point works on version CDCC - code is unchanged here CMPT EQU #125B2 * compute time HXDCW EQU #0ECB4 * full word hex to dec conversion IDIV EQU #0EC7B * integer divide, returns quotient and remainder FLOAT EQU #1B322 * dec integer to floating point conversion DV2-12 EQU #0C4A8 * divide two 12-forms CLRFRC EQU #0C6F4 * clear fraction (INT) RCD0D1 EQU #12A83 * recall D0,D1 from R4; see STD0D1 above FLTDH EQU #1B223 * floating point to hex integer conv. OUTELA EQU #05303 * decompile for parameterless statements NXTSTM EQU #08A48 * exit for statements MFWRN EQU #093BC * mainframe warning routine R3=D10 EQU #03526 * save D0,D1 in R3 FPOLL EQU #1250A * issue a fast poll D0=AVS EQU #09B2C * set D0 to available memory start TBMSG$ EQU #099AB * find & build message from LEX table ERRM$f EQU #09806 * transfer ASCII from AvMem to stack pTRANS EQU #EF * poll number for translator NIBHEX 00 * no parameters for this function HELLOF C=0 S * use R2(S) as a flag, clear for function R2=C * CMPT uses ST0-11, so we cannot use status bits GOTO TOD * jump to common code - calc time of day HELLOd GOVLNG OUTELA * decompile HELLOp RTNCC * parse REL(5) HELLOd REL(5) HELLOp HELLOD C=0 S * flag will be set for statement C=C+1 S * by incrementing C(S) R2=C * save the flag TOD GOSBVL STD0D1 * save the pointers GOSBVL CMPT * compute the time A=C W * copy C to A C=0 W * clear C to take constant P= 4 LCHEX 2A3 * set C,D = constant for 24 hr in 512ths D=C W GOSBVL IDIV * # secs since midnight GOSBVL HXDCW * to decimal A=C W GOSBVL FLOAT * float for arithmetic which follows C=0 W P= 12 LCHEX 512 * load 5.12 into C GOSBVL DV2-12 * divide; result=dec # secs * 100 GOSBVL CLRFRC * chop off the fractional part GOSBVL TRUNCC * cut to 12-digit form C=C-1 X * reduce exponent by 2 C=C-1 X * which is the same as /100 A=C W * floating happens in register A GOSBVL FLTDH * actual time since midnight in hex seconds B=0 A * prepare B(A) as a counter C=0 A * clear for a load C LCHEX A8C0 * midday in seconds (hex) ?A