The difference between MCU assembly pseudo instructions DATA and EQU

Publisher:TranquilDreamsLatest update time:2019-05-20 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. The EQU instruction is used to assign a value or register name to a specified symbol name.

Format: symbol name EQU expression  

       Symbolic 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 directly as an immediate value.

for example:

s equ bx+si

mov cx, [s]

Then the above two codes are equivalent to the following instructions:

mov cx,[bx+si]

2. The DATA instruction is used to assign an internal RAM address to a 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.

for example:

TEM DATA 50H

tem is an address

DATA (data address assignment command). 

    Function: Assign data address or code to the specified character name.

    Format: WATER DATA 30H.

    ※Differences between EQU and DATA:

    1) EQU must be defined before use, but DATA does not need to be defined.

    2) EQU can assign an assembly symbol to a character name, while DATA

        Pseudo-instructions cannot.

    3) DATA can be used in expressions, but EQU cannot.


Keywords:MCU Reference address:The difference between MCU assembly pseudo instructions DATA and EQU

Previous article:My opinion on STC microcontroller (I)-----IO port
Next article:STC MCU cannot download program and its solution

Recommended ReadingLatest update time:2024-11-17 00:07

MCU pin and port operation
I have written an article about microcontroller pins before. It was very simple. Today, when I saw the microcontroller's operations on reading pins and ports again, I was suddenly very puzzled. I searched the Internet for information and found a lot of explanations about the microcontroller IO port structure. After a
[Microcontroller]
The Path of Learning for a Newbie in Single-Chip Microcomputers (10) --- Dot Matrix
Goal: Light up a lamp using a dot matrix 1. Introduction to 8x8LED dot matrix LED dot matrix is ​​a display device composed of light-emitting diodes. It can be seen everywhere in the electrical appliances in our daily life and is widely used in car station announcers, advertising screens, etc. 8x8 dot matrix Use
[Microcontroller]
The Path of Learning for a Newbie in Single-Chip Microcomputers (10) --- Dot Matrix
51 MCU UART serial communication
Use half-duplex communication /************************************      Using the hardware UART module and serial port interrupt  ************************************/   #include reg52.h       typedef unsigned int uint;      void configUART(uint baud);      void main() {       EA = 1;       configUART(
[Microcontroller]
Elevator Control System Based on 51 Single Chip Microcomputer
1. Hardware Solution This design uses switch control to achieve up and down to the designated floor. The motor drives the elevator box to move up and down to reach the designated floor. The display module displays the current floor, and the alarm module has the function of erroneous operation alarm and floor arrival p
[Microcontroller]
Elevator Control System Based on 51 Single Chip Microcomputer
Songhan MCU digital tube program
; Digital tube----Purpose: Learn table lookup and indirect addressing  CHIP SN8F27E65 //{{SONIX_CODE_OPTION  .Code_Option WDT_CLK Flosc/4  .Code_Option Reset_Pin P04  .Code_Option LVD LVD_Max ; 3.3V Reset  .Code_Option Watch_Dog Disable  .Code_Option Low_Fcpu Flosc/1  .Code_Option High_Clk IHRC_16M ; Internal 1
[Microcontroller]
Understanding of MCU serial port
Serial Interface There are two communication modes for 8051 microcontroller: Parallel communication: Each bit of data is sent or received at the same time. Serial communication: Data is sent or received one bit at a time. See the figure below:     Serial communication method: Asynchronous communication:
[Microcontroller]
What are the washing machine series solutions? Detailed explanation of Lingou Chuangxin MCU washing machine solution
In 1855, American Hamilton Smith made the world's first washing machine. Since then, washing machines have continued to reshape people's living habits and daily scenes in a quiet and profound way. Currently, washing machines are evolving towards a more compact, reliable, beautiful, quiet, energy-saving and intellige
[Embedded]
What are the washing machine series solutions? Detailed explanation of Lingou Chuangxin MCU washing machine solution
Interface Design between LCD Display and PIC Microcontroller
1 Introduction In the design of intelligent instruments, it is usually necessary to display the measurement and control information. Due to the power consumption, volume and other conditions of the instrument, general CRT displays are often not suitable. Although semiconductor digital tubes can display numbers a
[Microcontroller]
Interface Design between LCD Display and PIC Microcontroller
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号