LEX 'CMDLEX' command stack size setter * TITLE CMDLEX Ver.<850714> , John R Baker * CON(2) #52 users library ID #1, see RAR# 00062 CON(2) #63 lowest token number CON(2) #63 highest token number CON(5) 0 no linked LEX 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 * *********************************************************** * * ****>EQUATE TABLE<**** * eMEM EQU #00018 Insufficient Memory Error flCALC EQU #FFFC0 value of CALC mode flag SFLAG? EQU #1364C routine to test system flags LEEWAY EQU #000D4 212 nibs, LEEWAY value AVMEME EQU #2F599 pointer to end of available memory FLTDH EQU #1B223 convert 12 form to hex integer RESPTR EQU #03172 restore D1 at parse time eIVARG EQU #0000B Invalid Argument error NUMCK EQU #0369D parses numeric expressions FIXDC EQU #05493 decompiles a fixed expression list EXPEXC EQU #0F186 executes expression @ D0, adds to STK NXTSTM EQU #08A48 reentry to BASIC interpreter CLCBFR EQU #2F576 start of command stack RAWBFR EQU #2F580 end of command stack MAXCMD EQU #2F976 size of command stack POP1N EQU #0BD1C pop 12 form into A (W) BSERR EQU #0939A BASIC routine error handler * *********************************************************** * * ****>MAIN TABLE<**** * CON(3) (TxEn01)-(TxTbSt) offset to Keyword REL(5) CMDSTK offset to execution code NIBHEX D a Statement, fully programmable * *********************************************************** * * ****>TEXT TABLE<**** * TxTbSt TxEn01 CON(1) (TxTbTm)-(TxEn01)-4 text length in (nibs)-1 NIBASC 'CMDSTK' ASCII of the BASIC Keyword CON(2) #63 Token number 63 hex associates * TxTbTm NIBHEX 1FF marks the end of the TEXT TABLE * *********************************************************** * * this loads the error number for bad CMDSTK input values * it then takes the normal BASIC error exit * sorry LC(4) eIVARG load 'Invalid Arg' error bserr GOVLNG BSERR goto BASIC error routine * ******************************** * * * the syntax is CMDSTK x where x is an integer 1-16 dec. * out of range values are trapped ******************************** pSCMD GOSBVL NUMCK parse for input number GOVLNG RESPTR restore parse input pointer ******************************** dSCMD GOVLNG FIXDC decompile a fixed expression list * ******************************** * REL(5) dSCMD offset to decompile routine REL(5) pSCMD offset to parse routine CMDSTK LC(5) flCALC if CALC mode is set disallow execution GOSBVL SFLAG? system pointers are all screwed-up GOC sorry error if CALC set, continue otherwise GOSBVL EXPEXC evaluate expression @ D0, push on STK GOSBVL POP1N pop to A (W) GOSBVL FLTDH convert to hex GONC sorry numbers > 1048575 * C=0 W ?A=0 A zero not allowed GOYES sorry take error exit A=A-1 A make 1-16 into 0-F LCHEX F ?A>C A weed out >16 nums GOYES sorry take error exit C=A A leave in A for MAXCMD C=C+1 A make 1-16 again C=C+C A size * 2 B=C A copy *2 to B C=C+C A size * 4 B=B+C A size * 6 = *2 + *4 D1=(5) CLCBFR C=DAT1 A get oldest entry pointer C=C+B A add new size R0=A save maximum count in R0 R1=C save end address in R1 B=C A also in B(A) LC(5) LEEWAY load value of LEEWAY in C(A) C=C+B A add LEEWAY to end address D0=(5) AVMEME A=DAT0 A get current end of available memory ?C