The definition and usage of several data partitions of c51

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.