1. DS --- reserved storage area command
Format: [label:] DS expression value
Its function is to define a storage area starting from a specified address for use by the source program.
The number of storage cells reserved for the storage area is determined by the value of the expression.
TMP: DS 1
Reserve 1 storage unit (byte) starting from the address labeled TEP.
2. BIT - define bit command
Format: Character Name BIT Bit Address
Its function is used to define the bit address for the character name.
SPK BIT P3.7
After definition, SPK is allowed to replace P3.7 in instructions.
3. USING instruction
The USING directive tells the assembler which set of 8051 working registers to use.
Format: USING expression (The value must be 0-3, the default value is 0.)
USING 0
Use group 0 of working registers.
4. SEGMENT instruction
The SEGMENT directive is used to declare a relocation segment and an optional relocation type.
Format: relocation segment name SEGMENT segment type [relocation type]
Among them, the "relocation segment name" is used to indicate the declared segment.
The "segment type" is used to specify the memory address space in which the declared segment will be located.
The available segment types are CODE, XDATA, DATA, IDATA, and BIT.
STACK_SEG SEGMENT IDATA
DATA_SEG SEGMENT DATA
5. RSEG - Relocation segment selection instruction
The relocation segment selection instruction is RSEG, which is used to select a previously defined relocation segment as the current segment.
Format: RSEG segment name
The segment name must be a relocation segment that has been declared previously.
DATA_SEG SEGMENT DATA ; declare a relocated DATA segment
RSEG DATA_SEG ; select the previously declared relocated DATA segment as the current segment
6. Absolute segment selection instruction
CSEG - Absolute Code Segment
DSEG - Internal absolute data segment
XSEG---External absolute data segment
ISEG - Internal indirect addressing data segment
BSEG - absolute bit addressing data segment
Format:
CSEG [AT absolute address expression]
DSEG [AT absolute address expression]
XSEG [AT absolute address expression]
ISEG [AT absolute address expression]
BSEG [AT absolute address expression]
The brackets are optional and are used to specify the base address of the current absolute segment.
CSEG AT 0000H
AJMP MAIN
7. ORG directive
The ORG instruction is used to change the assembler's counter, thereby setting a new program starting address.
Format: ORG expression
The expression must be an absolute or simple relocation expression.
ORG 0000H
AJMP MAIN
Set the starting address of the MAIN program to 0000H.
8. END instruction
The END instruction is used to control the end of the assembly. There must be an END instruction at the end of each assembly program.
And the END instruction can only appear once.
9. EQU directive
The EQU directive is used to assign a value or register name to a specified symbolic name.
Format: symbol name EQU expression
or symbol name EQU register name
The expression must be a simple relocation expression.
The character name assigned by the EQU instruction can be used as a data address, code address, bit address or
Use it directly as an immediate value.
LIMIT EQU 1200
COUNT EQU R5
10. DATA instruction
The DATA directive is used to assign an internal RAM address to the specified symbol name.
Format: symbol name DATA expression
The value of the numeric expression is between 0 and 255, and the expression must be a simple relocation expression.
PORT1 DATA 40H
11. DB instruction
The DB directive initializes code space with the bytes containing the value of the expression.
Format: [label:] DB expression table
The expression can contain symbols, strings, or expressions. Each item is separated by commas, and strings should be enclosed in quotation marks.
The label in brackets is optional. If used, the value of the label will be the address of the first byte in the expression table.
The DB instruction must be within the CODE section, otherwise an error will occur.
TABLE:
DB 0C0H, 0F9H, 0A4H
TABLE 1:
DB " WEINA "
Previous article:Using 51 single chip microcomputer to realize simple radio frequency wireless identification device system
Next article:Design of Single Chip Microcomputer Control System for Stepping Motor
Recommended ReadingLatest update time:2024-11-16 10:34
- Popular Resources
- Popular amplifiers
- Siemens PLC Programming Technology and Application Cases (Edited by Liu Zhenquan, Wang Hanzhi, Yang Kun, etc.)
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Implementing a Deep Learning Framework with Python (Zhang Juefei, Chen Zhen)
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
- Please tell me about external interrupt
- Recently, it has been reported that the prices of materials from imported semiconductor manufacturers have begun to fall.
- Is there a unified standard for the printed codes that can be recognized by the reading pen?
- MSP430G2553 MCU Programming Experience
- msp430g2553 electronic waste revival and reuse
- "Practice together in 2021" + difficult working life
- I would like to know if there are any microcontroller models with high-speed USB interface, ultra-high-speed I2C 1Mhz or above
- Servo drive
- C2000 for Sensing and Signal Processing
- μCOS-II Programming Basics