intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF (EN)

int e l CHAPTER 12 Command/Statement Extensions (Version 1.1 Only) MCS BASIC-52 V1.1 provides a simple, but yet effective way for the user to add COMMANDS and/or STATEMENTS to the ones that are provided on the chip. All the user must do is write a few simple programs that will reside in external code memory. The step by step approach is as follows: STEP 1 The user must first inform the MCS BASIC-52 device that the expansion options are available. This is done by putting the character 5AH in CODE memory location 2002H. When MCS BASIC-52 enters the command mode it will examine CODE memory location 2002H. If a 5AH is in this location, MCS BASIC-52 will CALL external CODE memory location 2048H.

The user must then write a short routine to SET BIT 45 (2DH), which is bit 5 of internal memory location 37 (decimal) and place this routine at code memory location 2048H. Setting BIT 45 tells MCS BASIC-52 that the expansion option is available. The following simple code will accomplish all that is stated above: ORG 2002H DB 5AH ; OG 2048H SETB 45 RET STEP 2 With BIT 45 SET, MCS BASIC-52 will CALL external CODE memory location 2078H every time it attempts to tokenize a line that has been entered. At location 2078H, the user must load the DPTR (Data Pointer) with the address of the user supplied lookup table, complete with tokens. - 153 -