Fixed 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:
Fixed refers to the first 256 RAMs 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 similar way to pointers in C. The statement in assembly is: mox ACC, @Rx. (Unimportant supplement: pointer access to idata in C works very well)
xdata:
External expansion RAM, generally refers to the external 0x0000-0xffff space, accessed with DPTR. pdata: The lower 256 bytes of external expansion RAM, read and write when the address appears on A0-A7, read and write with movx ACC,@Rx. 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 is not mentioned here.
What startup.a51 does
Just like assembly, the variables and arrays defined in C are initialized in startup.a51. If you define a global variable with a value, such as unsigned char data xxx="100", there will be a related assignment in startup.a51. If there is no =100, startup.a51 will clear it to 0. (startup.a51 == variable initialization). After these initializations are completed, the SP pointer will also be set. There will be no assignment or clearing of non-variable areas, such as the stack area.
Some people like to modify startup.a51 to satisfy their own hobbies. This is unnecessary and may be wrong. For example, when power-off protection is activated, you want to save some variables, but modifying startup.a51 is a stupid way to achieve this. In fact, you can just use the characteristics of the non-variable area and define a pointer variable to point to the lower part of the stack: 0xff. Why do you still need to modify it? It can be said that you don't need to modify startup.a51 at any time if you understand its characteristics.
Previous article:Several difficult concepts to grasp in single chip microcomputer learning
Next article:What is a MCU emulator? Principles of MCU emulator
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Collaborative SI-PI-EMI Simulation of Chip-Package-System (CPS)
- [Sipeed LicheeRV 86 Panel Review] The board is not responding
- Use stm32l452 to drive hts221 and stts751 routine
- [National Technology N32WB452 Review] + Basic Function Usage
- Will demand for SiC FETs increase in the future?
- Testing a battery-powered product with a 26K resistor between the battery pads (no battery is soldered at this time!),...
- When TMS320F28377D runs CLA, it shows that Cla1Task2 does not contain frame information
- Which one is better to use, the Type-C interface or the MicroUSB interface for mobile phone data cables?
- Showing goods + development board and multimeter
- Why is the GaN device [G-level is negative voltage powered]