In terms of data storage type, the 8051 series has on-chip and off-chip program memory, on-chip and off-chip data memory. The on-chip program memory is also divided into direct addressing area and indirect addressing type, corresponding to code, data, xdata, idata and pdata type set according to the characteristics of the 51 series. Using different memories will make the program execution efficiency different. When writing C51 programs, it is best to specify the storage type of variables, which will help improve the program execution efficiency (this issue will be specifically discussed later). Slightly different from ANSI-C, it is only divided into SAMLL, COMPACT, and LARGE modes. Different modes correspond to different actual hardware systems and will also have different compilation results.
The difference between data, idata, xdata, and pdata in the 51 series
Data: Fixedly refers to the first 128 RAMs from 0x00 to 0x7f, which can be read and written directly using acc, with the fastest speed and the smallest generated code.
idata: Fixedly refers to the first 256 RAM from 0x00 to 0xff, of which the first 128 are exactly the same as the 128 of data, but the access method is different. idata is accessed in a pointer-like manner similar to C. The statement in the assembly is: mox ACC, @Rx. (Unimportant supplement: pointer-style access to idata in C works very well)
xdata: external extended RAM, generally refers to the external 0x0000-0xffff space, accessed using DPTR.
pdata: The lower 256 bytes of the external expansion RAM, read and write when the address appears on A0-A7, use movx ACC, @Rx to read and write. This is quite special, and C51 seems to have a bug for this, so it is recommended to use it less. But it also has its advantages. The specific usage belongs to the intermediate problem, so it will not be mentioned here.
Previous article:Notes on using printf in KEIL C51
Next article:How to implement mixed programming of C51 and assembly
Recommended ReadingLatest update time:2024-11-23 08:28
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- How many hours do you want to work on one of your jobs?
- Six methods to check short circuit of PCB circuit board
- After looking at the computer test papers for primary school students this year, I found that I am not as good as the primary school students.
- Toshiba Photorelay Evaluation - Dynamic Characteristics Test (Part 2)
- Qorvo to Exhibit at IMS 2021
- RS Ruisen Semiconductor's application in power tools and lithium battery protection boards
- Emitter follower principle and typical circuit
- How to use the standard library time_t time(time_t *seconds)? Is there a difference between the value obtained by the parameter and the return value?
- I'm bored, so I'll post a tutorial on LNA
- TI's 430 routines have various modules, so read them carefully.