The way instructions give data to be operated is called addressing mode. In other words, addressing mode is to find the real address of the number involved in the operation.
There are 7 addressing modes in the instruction system of the MCS-51 series microcontrollers.
Immediate addressing mode is an addressing mode of the MCS-51 microcontroller. The operand is written in the instruction and placed in the program memory together with the opcode. Put the "#" sign in front of the immediate number to indicate that the addressing mode is immediate addressing, such as #20H. The immediate addressing mode is usually used to assign initial values to general registers or memory units.
In direct addressing mode, the operand field of the instruction gives the address of the operand participating in the operation. In the MCS-51 microcontroller, direct addresses can only be used to represent special function registers, internal data registers and bit address space. Among them, special function registers and bit address space can only be accessed using direct addressing mode.
Register addressing mode, the operand is in the register. The value of the three bits rrr in the instruction opcode and the status of RS1 and RS0 in PSW select a register in a certain working register area, and then perform the corresponding instruction operation. The operand required by the instruction is already stored in a register, or the target operand is stored in the register. The addressing mode that indicates the register to be used (i.e., the register mnemonic) in the instruction is called register addressing mode.
In indirect addressing mode, the instruction operand gives the register that stores the operand address. In the MCS-51 instruction system, the registers that can be used for register indirect addressing include working registers R0~R1, stack indicator SP and address register DPTR. In the instruction mnemonic, indirect addressing is represented by the symbol @.
The relative addressing mode uses the content of the current program counter pc as the base address and adds the one-byte complement number (offset) given by the instruction to form a new pc value.
Displacement addressing mode, among general registers, some registers can be used as displacement registers. Taking the sum of the content of the displacement register (usually the first address) and the address given by the instruction address code (usually the displacement) as the address of the operand to obtain the required operand is called displacement addressing.
Bit addressing mode refers to the addressing of some internal data storage RAM and special function registers when performing bit operations. When performing bit operations, the carry bit C is used as the operation accumulator, the instruction operand field directly gives the address of the bit, and then the bit is operated according to the nature of the operation code. The bit address is exactly the same as the byte address in byte direct addressing, and is mainly distinguished by the operation code.
Previous article:Working principle and usage of 51 single chip microcomputer timer
Next article:Summary of the 51 MCU learning MCU
- 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
- Anxinke PB-02 module evaluation (2) --- PHY62XX architecture introduction && design task introduction
- If you want to export data from Ansoft Designer, please read this.
- Migrate from M2M to IIoT
- What is your answer to the Huawei interview question that is trending on the Internet?
- IGBT application circuit for high current drive
- Brushless drive solution for circuit board
- CC2640RF Debug Interface (cJTAG)
- RTW Code Generation and DSP Development
- TI Action Camera and Handheld Gimbal Solutions
- PCB industry status