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

int e l 4.33 DESCRIPTION OF STATEMENTS STATEMENTS: UO1 and UO0 (USER OUTPUT) MODE: COMMAND AND/OR RUN TYPE: CONTROL UO1 The UO1 STATEMENT permits the user to write specific console output drivers for MCS BASIC-52. After UO1 is executed BASIC will call external program memory location 4030H when a console output is requested. The user must provide a JUMP instruction to an ASSEMBLY LANGUAGE OUTPUT ROUTINE at this location. MCS BASIC-52 places the output character in REGISTER 5 (R5) of REGISTER BANK 0 (RB0). The user returns back to BASIC executing an assembly language RET instruction.

The user must NOT modify any of the 8052AH's REGISTERS, including the ACCUMULATOR during the user output procedure with the exception of the MEMORY and REGISTER BANK allocated to the user. UO1 gives the user the freedom to write custom output routines for MCS BASIC-52. UO0 UO0 STATEMENT assigns the console output routine back to the software drivers resident on the MCS BASIC-52 device. UO0 and UO1 may be placed anywhere within a program. This allows the BASIC program to output characters to different devices at different times. NOTE: The UO0 and UO1 function is controlled by BIT 28 (1CH) in the 8052AH's internal memory. BIT 28 is in the internal memory location 35.4 (23.4H), i.e.

the fourth bit in the internal memory location 35 (28H). When BIT 28 is SET (BIT 28 = 1), the user routines will be called. When BIT 28 is cleared, (BIT 28 = 0), the MCS BASIC-52 output drivers will be used. The assembly language programmer can use this information to change the output device selection in assembly language. - 68 -