The code counter equ 0x20 sets an "assembler constant" to the hex value 20. The conversion of the symbols "0x20" to a binary value happens when the "equ" line is scanned by the assembler, which you can tell because if you make a typo, the error message occurs at that point. Later when you reference "counter", the assembler performs a value substitution at that point, inserting the binary value just as it would insert the value of a label. the code #define counter 0x20 tells the assembler to save the text "0x20". Later when the assembler sees "counter", it performs a textual substitution. If you made a typo in the 0x20, the error message would appear at the point where you referred to "counter", and not on the line where you made the actual typo. Since it's text, you can put anything into a #define that you want (for instance #define Serial_In PORTC,7 ), and it works or doesn't work depending on the context where you later use it. In this case, btfsc Serial_In would work, but goto Serial_In would get an error because a comma is illegal in the target of a goto. > -----Original Message----- > From: Martin SchŠfer [SMTP:Schaefer@ELEKTRONIK21.DE] > Sent: Monday, October 25, 1999 2:18 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Assembler Question (MPASM) > > Hi Pic freaks, > > I'm programming pic's for some years now. But there are always some > remaining mysteries. One of them: > > What is the difference between > > counter equ 0x20 > and > #define counter 0x20 > > > If I use counter in my assembler code like > > movwf counter > > there seems to be no difference. > > > Thanks for answering a such simple question :-) > > > Martin