Assembly language is a symbolic language that uses text mnemonics to represent machine instructions. It is the language closest to machine code. Its main advantages are that it takes up less resources and has high program execution efficiency. However, different CPUs may have different assembly languages, so it is not easy to port.
For the 8-bit MCU with RISC architecture that is currently widely used, its internal ROM, RAM, STACK and other resources are limited. If it is written in C language, a C language instruction will become many machine codes after compilation, which may easily cause problems such as insufficient ROM space and stack overflow. In addition, some microcontroller manufacturers may not be able to provide C compilers. In assembly language, one instruction corresponds to one machine code, and it is clear what action is performed at each step. In addition, the program size and stack call status are easy to control, and debugging is also more convenient. Therefore, in the development of microcontrollers with fewer resources, we still recommend the use of assembly language.
C language is a compiled programming language that takes into account the characteristics of multiple high-level languages and has the functions of assembly language. C language has rich library functions, fast computing speed, high compilation efficiency, good portability, and can directly control system hardware. C language is a structured programming language that supports the top-down structured programming technology widely used in current programming. In addition, C language programs have a complete module program structure, which provides a strong guarantee for the use of modular programming methods in software development. Therefore, using C language for programming has become a mainstream in software development. Using C language to write target system software will greatly shorten the development cycle, significantly increase the readability of the software, and facilitate improvement and expansion, thereby developing a larger system with more complete performance.
In summary, using C language for MCU programming is an inevitable trend in MCU development and application. Therefore, as a MCU developer who has comprehensive technology and is involved in large-scale software system development, it is best to master basic C language programming.
Previous article:The instruction system and addressing mode of the microcontroller
Next article:What are the advantages and disadvantages of C language and C++ when developing microcontrollers?
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- "Big Talk on Electronic Components and Circuits"
- How the electrification of automobiles develops voltage power board network
- DC servo motor driver is still very good
- On the RS485 side DB9 connector, what are the two PINs A and B respectively?
- 【Distributed temperature and humidity collection system】+MQTT debugging
- The channel for exchanging TI points for chip points has been opened. Full redemption within a limited time. The ultimate redemption is coming~
- An error occurred when simulating and debugging the program: no contex-m device found in jtag chain. How to deal with it?
- GPIO principle of TMS320F28335
- I really need help with this strange linking error. It has been bothering me for days.
- Oh my god, the teacher actually organized a high school student to take the college entrance examination for him (photo)