Electron wrote: > Hi, > I've a strong background in assembly but not on the dsPIC via MPLAB. What I > would like to know is how to make/use local labels. Example: > > > Routine1: > RCALL Hello1 > .loop: RCALL BlaBla1 > BTSS PORTF,#6 > BRA .loop > RETURN > > Routine2: > RCALL Hello2 > .loop: RCALL BlaBla2 > BTSC PORTG,#6 > BRA .loop > RETURN > > the assembler gives me an error at the definition of the 2nd ".loop" label, > while each .loop should be local to its own main label (Routine1 and Routine2)! > > How do I define local labels then? In most assemblers one uses ".", but in MPLAB? I'm not sure about dsPIC-assembler, but for PIC16/PIC18, I think that you have to have each routine in separate "modules". That is, in separate .ASM files. Then all symbols become local to it's own module and you have to use GLOBAL to actualy make them visible in other modules (if you want/need that). In your example, if Routine1 and Routine2 are in the same ASM file, the assembler will give you an error. Note that this *might* work different in dsPIC-assembler... In a *macro* definiton, you can use LOCAL to declare local symbols, but this wasn't any macro, right ? Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist