The _at_ keyword is used to specify the address of the variable when defining the variable.
The following are examples of using the _at_ keyword:
struct link
{
struct link idata *next;
char code *test;
};
struct link list idata _at_ 0x40; /* Define the structure located at address 0x40 in the lower 128 bytes of the internal RAM*/
char xdata text[256] _at_ 0xE000; /* define the array at the external RAM 0xE000 address */
int xdata i1 _at_ 0x8000; /* define an integer variable located at the address 0x8000 in external RAM*/
volatile char xdata IO _at_ 0xFFE8; /* Define external IO with address 0xFFE8 */
char far ftext[256] _at_ 0x02E000; /* define the array at the external RAM 0x2E000 address */
void main ( void ) {
link.next = (void *) 0;
i1 = 0x1234;
text[0] = 'a';
IO = 6;
ftext[0] = 'f';
}
In a .c file, these variables are defined as above, and can be referenced in another .c file as follows:
struct link
{
struct link idata *next;
char code *test;
};
extern struct link idata list;
extern char xdata text[256];
extern int xdata i1;
extern volatile char xdata IO;
Previous article:Keil C51's second keyword extension to C language: alien
Next article:51 MCU STC89C52 infrared decoding
- 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?
- 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
- Another technical solution for power-type plug-in hybrid: A brief discussion on Volvo T8 plug-in hybrid technology
- [RVB2601 Creative Application Development] Study Notes 1 - Development Environment Construction and New Project
- Free application: Erha image recognition artificial intelligence vision sensor (using K210, 1000 times faster than STM32H743)
- Choosing the Correct Thermistor for Your Temperature Sensor
- How to fix the program to FLASH in C6455 DSK of DSP C6000 series
- EEprom write speed is slow
- CircuitPython 7.0.0 released
- They are all six non-gates. This power supply can be used even if it is connected reversely, but it cannot be replaced.
- PCB layout
- About the test of power supply Wenbo
- [N32L43x Review] 3. Using serial port receive interrupt and idle interrupt to realize variable length data reception