Claude Sylvain wrote:
The assembler do not calculate properly the offset on an instruction
that use PC relative addressing mode (i.e.: mov.b P1OUT, R11).
it works for me :-)
Here is a partial listing:
--------------------------------------------------------------------------------------------------------
86 0000 5B40 1F00 mov.b P1OUT,r11
--------------------------------------------------------------------------------------------------------
is that after you ran the linker? the linker sets up relative addresses.
P1OUT is defined as:
.EQU P1OUT, 0x0021
why do you use that? you can get all the definition by #include <io.h>
(dont forget to pass -D_GNU_ASSEMBLER_ to the assembler and use a .S
suffix, invoke msp430-gcc with that file. it will run the assembler
withthe c preprocessor. see also example projects on mspgcc.sf.net
downloads/CSV e.g. the gfx_lcd one uses assembler files.)
The actual address of the instruction above is not yet known by the
assembler, and, theorically, it can not calculate the offset (
offset(PC) ) to put on the machine code, but, as you can see it put 1F00
(0x0021 - 0x0002). Seem, that the assembler do not know that the
address of the instruction is not the real address !?!?
the assember just starts putting the resulting machine code at address
0x0000, counting up. relocating it to the final position in Flash is the
job of the linker. (you can try hacks with .org but using the linker is
the propper way)
chris