int e l 1.8 FORMAT OF AN MCS BASIC-52 PROGRAM EPROM FILE FORMAT The EPROM FILE format consists of the same line and program format, previously described except that each program in the EPROM file begins with the value 55H. The value 55H is only used by MCS BASIC-52 to determine if a valid program is present. If the user types ROM 6, MCS BASIC-52 actually goes through the first program stored in EPROM line by line until the END of PROGRAM (01H) is found, then it examines the next location to see if a 55H is stored in that location. It then goes through that program line by line. This process is repeated 6 times.
If the character 55H is not found after the end of a program, MCS BASIC-52 will return with the PROM MODE error message. This would mean that less than six programs were stored in that EPROM. The first program stored in EPROM (ROM 1) always begins at location 8010H and this location will always contain a 55H. The actual user program will begin at location 8011H. EPROM locations 8000H through 800FH are reserved by MCS BASIC-52. These locations contain ini- tialization information when the PROGX options are used. Version 1.0 of MCS BASIC-52 only used the first three bytes of this reserved EPROM area. The information stored in these bytes is as follows:
LOCATION DESCRIPTION 8000 H CONTAINED A 31H IF PROG 1 WAS USED, CONTAINED A 32H IF PROG 2 WAS USED 8001 H BAUD RATE (RCAP2H) 8002 H BAUD RATE (RCAP2L) Version 1.1 of MCS BASIC-52 uses the same locations as Version 1.0, but additionally locations 8003H and 8004H (high byte, low byte) are used to store the MTOP information for the PROG 3, 4, 5, 6 options. IMPORTANT NOTE -- The PROG X options simply store ASCII character following the PROG command in location 8000H. That is why PROG 1 stores a 31H in location 8000H, PROG 2 a 32H, PROG 3 (Version 1.1 only) a 33H etc.
If the user employs the user defined reset option defined in Chapter 11 of this manual, it would be possible for the user to create unique PROG options. For example, PROG A would store a 41H in location 8000H and upon RESET the user could examine this location with an assembly language routine and generate a unique PROG A reset routine for that particular application. - 189 -