Tal Dayan wrote: > If I use the following code to allocate variables, everything works > just find except that the Watch window of the simulator does not allow > to watch the variables: > > org 0xc > myFirstVar res 1 ; allocate 1 byte > mySecondVar res 1 Correct. That's because "res" and "org" relate to addresses in the PIC's CODE memory, not DATA memory. Remember, the PIC has a Harvard architecture, in which code and data memories are separate; there's no need to "res" data memory. > The workaround I am using is: > > org 0xc > myFirstVar equ $ > res 1 > mySecondVar equ $ > res 1 > > What is the 'right' way to allocate variables ? Forget the "res" and just use EQUs... Or use the CBLOCK directive, which does essentially the same thing as EQU. Example #1: myFirstVar equ 0xC mySecondVar equ myFirstVar+1 Example #2: cblock 0xC myFirstVar mSecondVar endc -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu