When we use kei c51 to create a 51 microcontroller project, there will be a prompt as shown below:
When keil creates a new project, it prompts whether to add a startup file
Normally, you need to select "Yes". Of course, you can also choose not to add it. So, what is the role of this startup file? Under what circumstances does it need to be added, and under what circumstances can it not be added?
Today we will take a closer look at the content of this startup file. After understanding this content, we will have a sudden realization: "Oh, so this is it!"
Start the first paragraph of code
▼The following is the first paragraph of the original startup code:
strongerHuang • Source: Lao Ma Shi Tu MCU • Author: Lao Ma Shi Tu MCU • 2021-09-22 10:15 • 1508 times read
0
When we use kei c51 to create a 51 microcontroller project, there will be a prompt as shown below:
picture
When keil creates a new project, it prompts whether to add a startup file
Normally, you need to select "Yes". Of course, you can also choose not to add it. So, what is the role of this startup file? Under what circumstances does it need to be added, and under what circumstances can it not be added?
Today we will take a closer look at the content of this startup file. After understanding this content, we will have a sudden realization: "Oh, so this is it!"
Start the first paragraph of code
▼The following is the first paragraph of the original startup code:
$NOMOD51
;------------------------------------------------------------------------------
; This file is part of the C51 Compiler package
; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
; Version 8.01
;
; *** <<< Use Configuration Wizard in Context Menu >>> ***
;------------------------------------------------------------------------------
; STARTUP.A51: This code is executed after processor reset.
;
; To translate this file use A51 with the following invocation:
;
; A51 STARTUP.A51
;
; To link the modified STARTUP.OBJ file to your application use the following
; Lx51 invocation:
;
; Lx51 your object file list, STARTUP.OBJ controls
;
;------------------------------------------------------------------------------
;
; User-defined Power-On Initialization of Memory
;
; With the following EQU statements the initialization of memory
; at processor reset can be defined:
;
; IDATALEN: IDATA memory size <0x0-0x100>
; Note: The absolute start-address of IDATA memory is always 0
; The IDATA space overlaps physically the DATA and BIT areas.
IDATALEN EQU 80H
;
; XDATASTART: XDATA memory start address <0x0-0xFFFF>
; The absolute start address of XDATA memory
XDATASTART EQU 0
;
; XDATALEN: XDATA memory size <0x0-0xFFFF>
; The length of XDATA memory in bytes.
XDATALEN EQU 0
;
; PDATASTART: PDATA memory start address <0x0-0xFFFF>
; The absolute start address of PDATA memory
PDATASTART EQU 0H
;
; PDATALEN: PDATA memory size <0x0-0xFF>
; The length of PDATA memory in bytes.
PDATALEN EQU 0H
;
;
▼The following is the translation of the first paragraph of the startup code:
Predefined SFRs are not used. It is to tell the assembler not to use the predefined register name, because the assembler internally defines the register name of 51, but in actual use, it will use the 51 expansion chip such as 52. If the 52 header file is included, it will appear. Repeated definition, so you must first declare the register name that is not applicable to the internal definition of the assembler.
This file is part of the C51 compiler package
Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
Version 8.01
*** <
Previous article:The composition and format analysis of 89 series microcontroller model codes
Next article:Design of I2C bus interface circuit based on MCS-51 microcontroller
- 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
- Huawei GSM-R Solution
- C++ Multithreaded Programming Practice
- All subjects related to communication in Xi'an Electronics' postgraduate entrance examination
- Can't MSP430FR2433 use 3 hardware SPIs at the same time?
- How to set up WiMi-net wireless gateway?
- How to use the AIC1566 chip? Especially how to use it for short circuit protection?
- Keysight Technologies' Double 11 Shopping List is here, save it now!
- 【Course Special】Let’s talk about millimeter wave radar technology
- 200/700/1000mW wireless audio and video transmission system
- Improvement of online detection method of battery remaining capacity under high noise conditions