This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Indirect function calls in banking and LONG_MACRO

Hi,

I have not seen this problem addressed and I have been searching a long time. Perhaps I have just not used the right search terms.

I have 8 banks and have regular inter-bank and intra-bank calling working correctly. I am using mode 4 bank switch code in the L5_bank.a51 file. In the L51_bank.a51 file, there is a constant LONG_MACRO that is supposed to set to 1 when more than 8 banks are used or the bank switch code exceeds 256 bytes (either one breaks the optimized switching logic used).

By default, LONG_MACRO is set to 0. When I make indirect function calls they work fine. If I set LONG_MACRO to 1, the indirect function calls stop working properly.

After examining the assembly code, it appears that the indirect function pointers consist of the 16 bit function address shifted left by four bits OR'd with the 4 bit bank value in the LSBs. When LONG_MACRO is set to 0, the bank numbers seem correct. When LONG_MACRO is set to 1, they seem to all be 0. (I say seem to because I have tried limited examples).

Has anybody run into this issue?

HELP!!!

Regards,
Lee Mulcahy

Parents
  • Never mind (embarrassed grin)

    The extra nibble was an invention of one of the people who worked on the first version of our system. I still don't know why the CURRENT_BANK variable is not correct in the LONG_MACRO situation, but it ain't Keil's problem!

    Regards,
    Lee

Reply
  • Never mind (embarrassed grin)

    The extra nibble was an invention of one of the people who worked on the first version of our system. I still don't know why the CURRENT_BANK variable is not correct in the LONG_MACRO situation, but it ain't Keil's problem!

    Regards,
    Lee

Children
No data