| <<< Integer Constants | Index | TYPE, LENGTHOF and SIZEOF Operators >>> |
Two MASM directives,
symbol EQU expression
symbol = expression
generate integer constants. For example,
.CONST
column EQU 80 ; Constant 80
row EQU 25 ; Constant 25
screen EQU column * row ; Constant 2000
line EQU row ; Constant 25
.DATA
.CODE
mov cx, column
mov bx, line
Using symbolic constants instead of undescriptive numbers makes your code more readable and easier to maintain.
The assembler does not allocate data storage when you use either EQU or = .
The assembler simply replaces each occurrence of the symbol with the value of the expression.
Integers defined with the = directive can be redefined with another value in your source code, but those defined with EQU cannot.
| <<< Integer Constants | Index | TYPE, LENGTHOF and SIZEOF Operators >>> |