medge wrote: > Can someone tell me the difference between the "#define" and "equ" > directives? I have seen them used in the AN's but they both seem to serve > the same purpose. In principle, #define is a preprocessor directive. However, as far as I can tell, Microchip didn't actually implement it that way, so I'm not sure whether all of the examples I give below will actually work. #define can define a symbol which will be substituted for any string. The string does not have to be a numeric expression. Thus you can say #define foo "bar" #define somebit portb.7 #define subwl sublw ; some people claim the mnemonic sublw ; is backwards #define plus1 +1 in addition to the more mundane #define rstcmd 010h These definitions let you do things like: msgtab: addwf pcl msg1 equ $-(msgtab+1) dt "This is a message about",foo,".",0dh,0ah,0 or bcf somebit or subwl 72 ; subtract W from literal 72 In contrast, equ is a pseudo-op. It can only be used to define names for numeric constants. So you can do this: stopcmd equ 011h You should be able to combine uses of #defines and equ. A silly example: playcmd equ gocmd plus1 ffcmd equ playcmd plus1 In general, I use equ any time that I want to use a symbol for a fixed numeric constant, and #define for any other kind of substitution. Eric