Hi,
I'm attempting to jump to the address of a specific assembler label from within my C code, so I thought I'd try some embedded assembler;
For example;
void JumpToAsm(void) { __asm { IMPORT __asmlabel B __asmlabel } }
When I try to compile this code, I get the following error, referring to the IMPORT __asmlabel line. error: #3061: unrecognized instruction opcode
How do I import an external label into the inline assembler? I can't find any documentation on this specific point.
TIA, Jon Mills.
so I thought I'd try some embedded assembler That reasoning is quite badly wrong.
There's no reason to jump to embedded asm just to jump to a given address. You'll be much better off just declaring that external label as a C function and calling that. If the label has the wrong form, change the existing asm, or create a correctly named alias in a separate asm file --- don't throw a monkey wrench into your C code just because the assembly code doesn't fit.
Thanks for your direction - that was just what I needed.
I just created at C prototype with the same name as the label and then called it as if it were a C function.
extern void __asmlabel(void); void JumpToAsm(void) { __asmlabel(); }