LEX 'TRIGLEX' * PROMPTING ANGLE MODE CHOICE STATEMENT. ID #EC * 7/12/87, J.Elhay. MSG 0 POLL 0 ENTRY TRIG CHAR #D * A parameterless statement KEY 'TRIG' * Syntax: TRIG , responds only to D or R TOKEN 52 * for degrees or radians, respectively ENDTXT OUTELA EQU #05303 BF2DSP EQU #01C0E R3=D10 EQU #0352C SLEEP EQU #006C2 CKSREQ EQU #00721 POPBUF EQU #010EE FINDA EQU #023E3 SFLAGC EQU #13601 SFLAGS EQU #135FA D1C=R3 EQU #03047 NXTSTM EQU #08A48 DECOMP GOVLNG OUTELA * decompile for statements w/o parameters PARSE RTNCC * parse for same REL(5) DECOMP REL(5) PARSE TRIG GOSUB GETADR * get the address of next nib into RSTK NIBASC 'Angle Mo' * 1st 8 bytes of prompt NIBASC 'de?[D/R]' * 2nd 8 bytes of prompt NIBHEX D0A0FF * CR,LF and terminal FF bytes GETADR C=RSTK * pop the address of prompt string off RSTK D1=C * copy into D1 GOSBVL BF2DSP * put string into display SETHEX * needed for SLEEP GOSBVL R3=D10 * save pointers Sleep GOSBVL SLEEP * go to sleep GONC KEY * carry clear if key pressed GOSBVL CKSREQ * check for service requests GOTO Sleep * and go back to sleep KEY GOSBVL POPBUF * pop the key from the key buffer A=B B * copy the keycode into A(B) GOSBVL FINDA * is it one of the keys in the table below? CON(2) #11 * the D key REL(3) DEG * want degrees CON(2) #04 * the R key REL(3) RAD * wanted radians CON(2) 0 * end of table GOTO Sleep * not D or R, go back to sleep DEG P= 0 * prepare to load flag Nú into C(B) LC(2) #F6 * -10 decimal is F6 in hex (as a complement) GOSBVL SFLAGC * clear this flag GONC nxtstm *BET* exit from SFLAGC leaves carry clear RAD P= 0 * as for degrees LC(2) #F6 GOSBVL SFLAGS * set this flag nxtstm GOSBVL D1C=R3 * restore pointers D0=C GOVLNG NXTSTM * go on to NeXT STateMent.