Equ is basically just a text substitution instruction - so every occurrence of But1 will be replaced by 0x00 at assemble time.
PIC's, like all processors, don't 'speak' words, only numbers - all the words are only for your convenience, and are converted to numbers by the assembler.
You're not actually understanding the 'dummy' example you gave either, all that line does is replace every occurrence of Dummy by the value 0x20, it has nothing whatsoever to do with any registers, it's just a number. However, as the address 0x20 is a GPR, as long as you use the name Dummy in the correct place, program instructions referencing Dummy will access the GPR address 0x20.
But2 connects to a specific pin on the PIC, referenced by 0x01 - using an Equ to reference it makes it more legible, and allows you to simply alter the Equ if you move it to a different pin.
But2 connects to a specific pin on the PIC, referenced by 0x01 - using an Equ to reference it makes it more legible, and allows you to simply alter the Equ if you move it to a different pin.
is not stored anywhere in a way that you could access it again, it usually becomes a part of the insturcion that manipulates it as an immediate operand after you assemble the source code.
ADD r1, But2 is the same thing as ADD r1, 0x01 (general syntax, I have no idea how pics have the instructions)
Maybe the assembler replaces it with some other instruction? Does the microcontrolle in question have something like a constant generator/register?
So, what do you see in the program memory instead?
you need to make a very short program that only does the instruction you want to see, or use some debugger to step through the code and see what has the movlw instruction changed into.
well since you don´t use that "but" definition anywhere in the code, it will not appear anywhere in the assembled file.
Normally assembler has directives like db and dw that store values in the program memory. The equ is just an alias, the same way like #define in C.
well since you don´t use that "but" definition anywhere in the code, it will not appear anywhere in the assembled file.
Normally assembler has directives like db and dw that store values in the program memory. The equ is just an alias, the same way like #define in C.