1. Introduction:
Differences between data, idata, xdata, and pdata in the 51 Series
Data: fixed to the first 128 Ram records of 0x00-0x7f, which can be directly read and written using acc. The fastest speed and the smallest code generated.
Idata: it refers to the first 256 Ram records of 0x00-0xff. The first 128 is the same as the first 128 of data, but the access method is different. Idata is accessed using pointers similar to those in C. The statement in the Assembly is mox acc, @ Rx. (It is not important to add: idata in C performs pointer access well)
Xdata: External extended RAM, usually refers to the external 0x0000-0xffff space, accessed with dptr.
Pdata: External extended RAM 256/or 128 bytes low, the address appears on the A0-A7 read and write, with movx ACC, @ RX read and write, pdata can be regarded as the area before xdara.
2. Usage:
2. 1 xdata and pdata usage
Basically the same, the difference is that the range of the Data zone is different. Ram that can be used for expansion, or extended special function registers.
The 51 microcontroller in myson is described as follows:
Extended RAM: Auxiliary RAM (auxram) There are total 768 bytes auxiliary Ram allocated in the 8051 external Ram area 800 H-affh. program can use "movx" instruction to access the auxram.
Extended special function registers: external special function registers (XFR) the XFR is a group of registers allocated in the 8051 external Ram area f00h-fffh. These registers are used
For OSD control or other special function. program can use "movx" instruction to access these registers.
Because the addresses are unified, the usage of these two auxram & XFR methods is the same.
The key is that there are two different processing methods in C51:
2. 1. 1. directly regard it as an array.