int e l CHAPTER 7 Special Operators 7.1 SPECIAL FUNCTION OPERATORS SPECIAL FUNCTION OPERATORS are called SPECIAL FUNCTION OPERATORS because they di- rectly manipulate the I/O hardware and the memory addresses on the 8052AH device. All SPECIAL FUNCTION OPERATORS, with the exception of CBY([expr]) and GET, can be placed on either side of the replacement operator ( = ) in a LET STATEMENT. EXAMPLES: A = DBY(100) and DBY(100) = A+2 Both of the above are valid statements in MCS BASIC-52. The SPECIAL FUNCTION OPERATORS in MCS BASIC-52 include the following: CBY([expr]) The CBY([exprl] operator is used to retrieve data from the PROGRAM or CODE MEMORY address space of the 8052AH.
Since CODE memory cannot be written into on the 8052AH, the CBY([expr]) operator cannot be assigned a value. It can only be read. EXAMPLE: A = CBY(1000) Causes the value in code memory space 1000 to be assigned to the variable A. The argument for the CBY([exprl] operator MUST be a valid integer (i.e. between 0 and 65535 (0FFFFH) ). If it is not, a BAD ARGUMENT ERROR will occur. DBY([expr]) The DBY([expr]) operator is used to retrieve or assign a value to the 8052AH's internal data memory. Both the value and argument in the DBY operator must be between 0 and 255 inclusive.
This is because there are only 256 internal memory locations in the 8052AH and one byte can only represent a quantity between 0 and 255 inclusive. EXAMPLES: A=DBY(B) and DBY(250) = CBY(1000) The first example would assign variable A the value that is in internal memory location B. B would have to be between 0 and 255. The second example would load internal memory location 250 with the same value that is in program memory location 1000. - 86 -