int e l 9.6 ADDED LINK ROUTINES TO VERSION 1.1 Version 1.1 of MCS BASIC-52 contains a number of useful assembly language link routines that were not available in Version 1.0. Most of these routines were designed to be used in conjunction with the new Command/Statement extensions that are described in Chapter 11 of this manual. The added link routines are as follows: OPBYTE = 57 (39H) EVALUATE AN EXPRESSION WITHIN THE BASIC TEXT STRING AND PLACE THE RESULT ON THE ARGUMENT STACK This routine permits the user to evaluate a BASIC expression [expr] containing variables, operators and constants. The result of the evaluated expression is placed on the floating point argument stack.
This lets the user evaluate expressions in "customized" statements and commands. An example of use of this OPBYTE is given at the end of this section. OPBYTE = 58 (3AH) PERFORM CRYSTAL DEPENDENT CALCULATIONS WITH THE VALUE THAT IS ON THE ARGUMENT STACK This routine is provided mainly to let the user write an assembly language RESET routine and perform all of the crystal dependent calculations that are required by MCS BASIC-52. An example of a customized RESET routine that uses this OPBYTE is presented in Chapter 11 of this manual. OPBYTE = 63 (3FH) GET A CHARACTER OUT OF THE BASIC TEXT STRING This routine permits the user to "pick" a character out of the BASIC program.
For instance, in BASIC the user could have the following: 10 CALL 1000H A If the user executed the following in assembly language at 1000H: MOV A, #63 LCALL 30H The character A would be returned in the accumulator. The Basic text pointer is located in location 8 (8H) (low byte) and 10 (0AH) (high byte) of the internal ram on the MCS BASIC-52 device. If the user were to implement the above function, the basic text pointer must be advanced to the carriage return at the end of the statement before returning back to Basic. Failure to do this will cause a BAD SYNTAX ERROR when the user returns back to Basic. The following OPBYTE can be used to advance the Basic Text pointer. - 122 -