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

int e l 7.1 SPECIAL FUNCTION OPERATORS XBY([expr]) The XBY([expr]) operator is used to retrieve or assign a value to the 8052AH's external data memory. The argument in the XBY([expr]) operator must be a valid integer (i.e. between 0 and 65535 (0FFFFH)) . The value assigned to the XBY([expr]) operator must be between 0 and 255. If it is not a BAD ARGUMENT ERROR will occur. EXAMPLES: XBY(4000H)=DBY(100) and A=XBY(0F000H) The first example would load external memory location 4000H with the same value that was in internal memory location 100. The second example would make the variable A equal to the value in external memory location 0F000H.

GET The GET operator only produces a meaningful result when used in the RUN mode. It will always return a result of zero in the command mode. What GET does is read the console input device. Actually, it takes a "snapshot" of the console input device. If a character is available from the console device, the value of the character will be assigned to GET. After GET is read in the program, GET will be assigned the value of zero until another character is sent from the console device. The following example will print the decimal representation of any character sent from the console: EXAMPLE:

>10 A=GET >20 IF A 0 THEN PRINT A >30 GOTO 10 >RUN 65 (TYPE "A" ON CONSOLE) 49 (TYPE "1" ON CONSOLE) 24 (TYPE "CONTROL-X" ON CONSOLE) 50 (TYPE '2' ON CON8OLE) The reason the GET operator can be read only once before it is assigned a value of zero is that this implementation guarantees that the first character entered will always be read, independent of where the GET operator is placed in the program. - 87 -