EQU - DC.B. What is the difference?

I just started learning assembly language. I came across an EQU concept. At first it made sense until I got to DC.B. What is the difference between DC.B and EQU? Can't you just use EQU for each constant?

+7
source share
1 answer

I am not familiar with your specific assembler syntax, so this answer is a reasonable assumption.

The EQU directive is used to tell the assembler that you want to have a named symbolic constant (often computed from other assembler values, including other EQU definitions) that you can reference elsewhere in the assembly source code. You should always write

 symbolname EQU constantexpression

. .

"DC.B" ( , " ()" , , ".

optionalname DC.B  constantexpression

.

,

 AnEvenNumber  EQU    2
 MyEvenNumber  DC.B   AnEvenNumber

. , , .

, DC.B ; . ,

 LocationOfEvenNumber EQU  MyEvenNumber

      DC.W    LocationOfEvenNumber

, "" .

+13

All Articles