Followup. Here's a self-contained demo of the problem. Compiles with
msp430-gcc main.S -mmcu=msp430x133 -o main.elf
Watch it run and check that while 2(r1) contains the address of correct(),
actually wrong() is called. Tried with an M430F133 as well an M430F147.
Best,
Heiko
.file "main.c"
.arch msp430x133
.text
.p2align 1,0
correct:
push r14
pop r14
ret
.p2align 1,0
wrong:
push r15
pop r15
ret
.p2align 1,0
.global main
.type main,@function
main:
mov #0x300, r1
sub #4, r1
mov #correct, 2(r1)
mov #wrong, 0(r1)
call 2(r1)
add #4, r1
br #__stop_progExec__