How do I perform a long jump to a numerical address from my C code? I'm pretty sure I have to do this with inline assembly - however that seems complicated for C51. I figured in C I could do this:
typedef void (*jmpPtr)(void); jmpPtr jmp; ... unsigned int address = 0x4000U; jmp = (jmpPtr) address; (*jmp)();
Just to make it more readable I suppose. I'm not sure I'd agree that 5 lines is more readable than 2. To each their own. Setjmp() and longjmp() save the state from one code point to another and doesn't allow for specifying an address. Good point. If you don't like the LCALL then you'll have to use some assembler I'm afraid. How bad is the LCALL implementation for you? - Mark