【正文】
s address also on the register R0 or R1 Medium. If the address of RAM is greater than 256, the address stored in 16bit register DPTR (data pointer), the time at the former register add symbol to indicate such an indirect addressing. Such as MOV A, R0. Other sides have variable addressing, relative addressing, bitaddressable and so on, to be detailed later. Some people might ask, in the instruction directly give the number of actual operation is not easy to understand? Why should we use several other addressable way This is because it is very difficult in the preparation of procedures immediately give operand. Such as using singlechip control of temperature, from time to time required to control a given temperature (such as 20 ) minus the ambient temperature, and ambient temperature has changed from time to time, apparently unable to give orders in the proceedings only through the way must be into an input / output port, and then stored in a register, which must be used for addressable register. Another example is to carry out arithmetic operations, various participants in each class to calculate the average score, if each student put the sections are made of a procedure, in the proceedings directly give the students grade subjects, and then for the average, it is clear too much trouble. Here can be made for an average grade of a mon procedure, put each participant39。s designated address, the corresponding unit from the ROM mand byte out on the instruction register in the storage, then, an instruction register of the instruction decoder code was translated into various forms of control signals, these singlechip signal and clock oscillator generated clock pulse in timing and control circuit bination of a certain period of time according to changes in electric calm beat the clock, the socalled control of information in the CPU internal coordination between the register data transfer, puting and other operations. Then tell us about memory, memory MCU are also an important ponent of has a storage capacity of 256 units of memory structure. One of each memory cell corresponds to an address, a total of 256 unit 256 addresses, use two 16 hexadecimal numbers, that is, memory address (00H ~ FFH). Memory of each memory cell can store one of eight binary information, usually using two 16band number to express, and this is the contents of memory. Memory storage unit address and the contents of memory cells are two different concepts, should not confuse. Singlechip also includes the program memory. Process control puters are a series of action mands, Microcontroller Know only by 0 and 1 consisting of machine code instructions. Such as the preparation of the foregoing order with Mnemonic MOV A, 20H, Know the code into the machine 74H, 20H: (written in binary is 01110100B and 00100000B). Problem in SCM is required before the deal will be good procedures, tables, constants piled into machine code into singlechip memory, the memory referred to as program memory. Program memory can be put on the chip or chip, chipchip can also be set up simultaneously. As the PC program counter to 16, making the procedure available for 16bit binary memory addresses, therefore, both inside and outside the memory address from 0000H to the largest FFFFH. 8051 has 4k bytes of internal ROM, on the occupied by the 0000H ~ 0FFFH minimum 4k bytes, when the expansion of chip program memory address number shall be 1000h start, if you use 8051 as a 8031, do not want to use chip 4kROM , all used memory chip, then the address code can still start from , when EA feet should be used to maintain the low level. When EA is high, the user 0FFFH at 0000H to use internal ROM, more than 0FFFH, the singlechip CPU automatic access to external program memory. Singlechip data memory RAM memory by reading and writing ponents. Its maximum capacity can be expanded to 64k, used to store realtime input data. 8051 has 256 units within the internal data memory, one of 00H ~ 7FH for internal random access memory RAM, 80H ~ FFH area dedicated registers. Actual use should be the first full use of internal memory, from the use of perspective, to understand the structure of internal data memory and address of the distribution is very important. Since studying at the future directions of design systems and procedures will be frequently used them. 8051 internal data memory address 00H to FFH by a total of 256 bytes of address space, the space was divided into two parts, one of the internal data RAM address 00H ~ 7FH (that is, 0 ~ 127). The Special Function Registers to do with the address 80H ~ FFH. In this 256byte also has opened up a socalled digital address area, the region can not only byte addressable, but also by the bit (bit) addressable. For those required to carry out the operation of the data bit can be stored into the region. From 00H to 1Fh arranged group of four working registers, each occupied by 8byte RAM, recorded as R0 ~ R7. Whether the choice of which set of registers, from the aforementioned signs register in the selection of RS1 and RS0. Add on at these two different binary number, you can choose different registers. Special Function Register (SFR) address the range of 80H ~ FFH. At MCS51, in addition to program counter register PC and four job outside the region, and the remaining 21 special function registers in this block in SFR. Are one of five doublebyte register, and they take up a total of 26 bytes. Special Function Registers of the symbols and addresses, see Schedule 2. With * one of the availablebit addressing. Special Function Registers status reflects the 8051, 8051 are in fact the status word and control word register. CPU PSW is typical for a case. These Special Function Registers generally classified into two categories, one category with the pin on the chip, and the oth