User Tools

Site Tools


home:software:picasm

This is an old revision of the document!


PIC ASM

Here you can find tips, tricks, tutorials and documentation concerning the Microchip PIC assembler language.

Tips & Tricks, Questions and Answers

How to locate two lables at the same memory position?

If you want to export a label for C applications, and you want to use the same name for the variable in C and ASM, you can do this in the way shown here (for example in module_xxx.asm):

global VAR1
global VAR2
global _VAR1
global _VAR2

MY_VARS UDATA
_VAR1 RES 0
VAR1 RES 1
_VAR2 RES 0
VAR2 RES 1

This will put _VAR1 / VAR1 at the same memory position. Never put the _VAR1 RES 0 *after* VAR1 RES 1! This would cause the assembler to give _VAR1 an address, but would not reserve any memory for it!

Also refer this discussion in the forum: http://www.midibox.org/forum/index.php/topic,12846.0.html

home/software/picasm.1232502089.txt.gz · Last modified: 2009/01/21 01:41 by this