One lesson per day (19/75) Symbolic Definition Statement

Source: Internet
Author: User
The purpose of a symbolic Definition Statement is to use a symbol instead of a constant or numeric expression that is frequently used. Code You only need to modify the symbolic Definition Statement.

Symbol definition statements are divided
1 equivalent statement equ
2 equal sign Statement =
3. Label

1. equivalent statement
Equ expression

For example, you can use Symbolic equivalent statements to represent constants or expressions.
Number equ 100
Buff_len equ number + 2

You can also use Symbolic equivalent statements to define a long string constant.
MSG equ "Hallo world"

You can also use Symbolic equivalent statements to define an instruction or register.
Move equ mov
Counter equ CX

You can also use Symbolic equivalent statements to create an alias for another data type in one memory area.
Word1 equ this word
Byte1 dB 12 h, 21 h
At this time, word1 is 2112 H.

2 equal sign statement
The assembly language provides a method for defining symbolic Constants by equal signs, that is, a constant can be represented by a symbolic name. Format:
Symbol name = numeric expression
For example
Abc= 100*5
Def = ABC * 5

3. symbolic name Definition Statement
The label function of the symbolic name Definition Statement is similar to that of this statement. This statement has a specified symbolic name. The segment address and offset of the symbolic name are the same as the corresponding attributes of the storage unit that follow below, however, the type of the symbol is newly specified. The general format of the label statement is:
Symbol name label type
Common types include byte word DWORD near far
For example
Wbuffer label word
Buffer dB DUP (0)
Wbuffer and buffer have the same segment address and offset, but their data types are different.

Next1 label far
Next: mov BX, ax
Next1 and next have the same segment address and offset, but next1 is the far mark, and next is the near label. In the same module, you can use next to transfer data between different modules, and use next1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.