EQU — 어셈블 타임 상수
EQU는 메모리를 전혀 할당하지 않는다.DB와의 차이가 핵심.
DB EQU 선언 num DB 5CONST EQU 9메모리 할당 ✅ 있음 ❌ 없음 동작 주소를 통해 값 참조 어셈블 중 숫자로 매크로처럼 복붙 결과 메모리 피연산자 즉시 피연산자로 인라인됨
CONST+3은 어셈블러가9+3 = 12로 계산해 바이너리에0C 00을 박는다. 런타임에는 CONST 라는 이름 자체가 존재하지 않는다.
Programmer's Guide.pdf, Chapter 1 (Page 12) - Symbolic Integer Constants
You can define symbolic integer constants with either of the data assignment directives,
EQUor the equal sign (=).The directives
EQUand=have slightly different purposes. Integers defined with=can be redefined, but those defined withEQUcannot. Once a symbolic constant is defined withEQU, redefining it generates an error.Syntax:
symbol EQU expression