^ma1 80^pl-62 0 0 ^sk2^co ^sk1CMDSTK ^sk2 --- --- |X| Statement |X| Keyboard Execution --- --- --- --- | | Function | | CALC Mode --- --- --- --- | | Operator |X| IF...THEN...ELSE --- --- ******************************************************************************** SYNTAX DIAGRAM: follows standard HP format see: HP 71 Reference Manual (00071-90010) page 8 /--------\ -------------- | CMDSTK |----+---->| Expression |--+--> \--------/ | -------------- ^ | | | ------------- | |---->| Literal # |-->| ------------- ^paWhere "Expression" is a standard HP71 numeric expression which evaluates to the range 1-16 (decimal). Negative numbers are not allowed. ^paWhere "Literal #" is a literal integer in the range of 1-16 decimal. Values which are outside of the range of one to sixteen (in decimal) are trapped. ^co ******************************************************************************** ^sk1^fiEXAMPLES: ^sk1CMDSTK 16 , sets the size of the command stack to sixteen. ^sk1CMDSTK A3 , sets the size of the command stack to the value in variable A3. ^sk1CMDSTK((64-32)/2) , sets the command stack to 16 (result of the expression). ^sk1CMDSTK 2+3 , sets command stack to 5 (result of expression). ^ad ^sk3^co INPUT PARAMETERS: -------------------------------------------------------------------------------- | Item | Description | Restrictions | -------------------------------------------------------------------------------- | Expression | Numeric expression | 1 through 16 | | | | | | Literal # | a literal number | 1 through 16 | -------------------------------------------------------------------------------- ^sk2COMMENTS: ^sk1^paThis Keyword allows the user to easily change the size of the HP71 'Command Stack'. After a Coldstart or an INIT:3, the HP71 Command Stack is normally set to hold 5 entries. There is no provision in the HP71 mainframe to alter the Command Stack size. The Command Stack is capable however, of being set to hold from one to sixteen entries. This Keyword, CMDSTK, will alter the Command Stack size from one to sixteen. Attempting to set the size to a value outside this range results in the error "INVALID ARG". If this error occurs, the current Command Stack size is NOT altered. If this error occurs within a running program, execution will be halted. Due to the way that the command stack is resized, any previous entries in the stack will be lost after execution of this Keyword. ^sk1^paFollowing is a brief description of the operation of this Keyword. Users desiring more detailed information are referred to the HP71 "Software Internal Design Specification Volume 1" (HP part # 00071-90068). Detailed information about the Command Stack is in IDS Volume 1, Chapter 3, page 35. ^paWhat the Command Stack is is a 'doubly linked' list of buffers which exist in memory. Each entry in the Command Stack contains the ASCII text followed by a Carriage Return. Immediately preceeding and following each entry is linkage information (needed so the up & down arrow keys may be used to step through the list). What this Keyword does is to, First, verify that the new size specified is within the range of 1-16. If not in range, an error exit is taken to avoid corrupting HP71 memory. Second, if in range, several HP71 'system pointers' are updated so that the HP71 knows where in memory the Command Stack begins, ends, and the total number of entries possible. Third, new linkage information is written to memory thereby creating a new Command Stack of the specified size. Writing the new links causes all information contained in the old Command Stack to be lost. Finally, control is returned to the BASIC Interpreter.