Syntax Error when Popping the Link Register (using code from Docs) #14312
-
This is example code from the documentation. I get this error on the pop instruction.It doesn't like popping the lr.
Error:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
ANSWER
It takes the address in the link register and shoves it directly into the program counter. |
Beta Was this translation helpful? Give feedback.
-
The problem here may be that the docs - and the Assembler! - were written for the Pyboard (Arm V7) while the Pico is Arm V6. Note the floating point instructions, absent on the Pico. There are restrictions on what you can do with registers > r7. |
Beta Was this translation helpful? Give feedback.
-
Just hit this on RP2040 too, when trying fib example from Both previous answers are a bit confusing but provide good hint.
so
is replaced by
|
Beta Was this translation helpful? Give feedback.
ANSWER
Instead of
It takes the address in the link register and shoves it directly into the program counter.