Forum : 8051
Original Post
Post Information | Post |
---|---|
March 6, 2012 - 9:10pm
|
Hi The function unsigned char ValidateLUT ( void ) is in a different code bank. For the statement: the RC51 compiler (3.08.10.0309) generated this code: 00B6 020000 R LJMP ValidateLUT Will the linker handle this correctly, i.e. replace the LJMP with a call to bank switching code? When I spotted this, I felt happier to replace my code with: Result = ValidateLUT ( ) ; which generated the following code: 00B6 120000 R LCALL ValidateLUT Was I worrying unnecessarily? Thanks. Damien |
Hi Damien,
The linker doesn't know about LCALL, LJMP and any other instructions. It only deals with fix-ups and in your case, the fix-up is the same for LCALL and LJMP, so if the bank switching works with the LCALL, it must work with the LJMP.
Regards,
Stéphane