Usually, an entry in the symbol creates what assembler writers have called an "assembler constant". Usually, if for some reason, it changes, that's a bad thing. Most assemblers are "two pass", the first pass counts the instructions and figures out what addresses they will load at (making "assembler constants" for all the labels as it goes). In the second pass, the code is spewed out to wherever. If the address of a label is different in the second pass, then something's royally fouled up. So, if you try to change the value of something by having two equ's for it, the assembler complains, often with the obscure "phase error" message. Sometimes in a macro, you need something that acts more like a variable. If you notice, MPASM macros actually have looping directives, so you can actually write little code-writing (or more often table-writing) snippets of code. That's what the SET directive is for. Basically, it's just an equ with the "isn't allowed to change" rule relaxed. These can be very powerful, but are often like a siren, luring programmers into creating totally incomprehensible whirlpools of code. > -----Original Message----- > From: Martin SchŠfer [SMTP:Schaefer@ELEKTRONIK21.DE] > Sent: Monday, October 25, 1999 3:09 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Assembler Question (MPASM) > > Thank you Ben, > > what you wrote seems to be what I was looking for. If the EQU directive > creates > an entry in the symbol table and the #define not, than debugging is only > possible > with the EQU directive. > > Similar to the EQU directive is also the SET directive. Where can you use > the > SET > in an efficient way? > > Martin > > Ben Stragnell schrieb: > > > Martin, > > > > The EQU directive typically creates an entry in the assembler's symbol > > table, and > > assigns a value to it. > > > > #define is a preprocessor directive, which is more of a > text-substitution > > approach. > > > > In the example you give, there is no real difference. However, in some > > assemblers, > > and in C, #define can be used in a much more versatile manner, for > instance, > > for > > creating macros. > > > > Cheers, > > Ben > >