The general format of an MCS-51 assembly language program
* Unlike 8086, there is no distinction between code segment and data segment, and all addresses are unified.
* A program consists of command lines or comment lines. Each command line can only contain one command.
* “Label:” can be used before an instruction to indicate the instruction address for easy reference in the instruction; a label is a symbolic name that starts with a letter.
* Comment lines should start with a “;”; “;” can also be used to separate additional comments after instructions.
* The program is located by the pseudo instruction ORG XXXXH. The 16-bit address in ORG is the absolute address to be written into the program memory in the future. The ORG in the program should be arranged from small to large addresses. The program segments located by ORG can be discontinuous. The assembler will fill 00H, i.e. NOP, in the empty addresses between segments. Therefore, the last instruction of each ORG segment should generally be a transfer instruction.
* Data is described by pseudo instruction DB (byte) or DW (double byte). The value should start with a digit 0-9; the suffix description: B-binary, D-decimal, H-hexadecimal. Decimal D can be omitted.
* The EQU directive can define an equivalent field so that a symbolic name can be used to represent an operand, for example:
aa EQU 30H
bb EQU #30H
MOV A,aa; aa is equivalent to "30H", the instruction is MOV A, 30H
MOV R0,bb; bb is equivalent to "#30H", the instruction is MOV R0,#30H
Previous article:Design of real-time monitoring circuit for display data of air conditioner mainboard
Next article:Design of temperature acquisition system based on single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 21:43
- Popular Resources
- Popular amplifiers
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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MCU Learning
- STM32 drives LIS25BA
- The opportunity to get a free infrared thermal imager is here! AutoNavi 2019 Temperature Measurement New Product Launch Conference
- Advantages of Inverted Buck for Low Power AC/DC Conversion
- Flying probe test to detect the electrical performance of PCB boards
- Correct timing
- How to use the crystal oscillator and capacitor in the TaunchPad G2 kit?
- How to set the PCB wiring to 100 Ω uniform routing?
- Hello everyone, I made a microphone, and I need to use a preamplifier, I use MC2830D, the effect is average
- ADI New Chinese Information (July 2019)