Hello,
I use a ST10F269 (SMALL-modell) with Keil C166 v6. I try to call a RAM-routine (in XRAM2) from ROM (in Segment 2 => all code is located within 64kB in Segment 2) via assembler routine:
BCLR IEN CALLS #0,#SOF fls_ram BSET IEN
fls_ram is a variable at address 0xDBBE
What I expect is, that the call is to address 0xDBBE but it is to address 0x9BBE (14bit address).
When I use: MOV R4, #SOF fls_ram it works fine, I have the 16bit-address in register R4 but not with CALLS, JMPS, ..
Are there restrictions for the use of #SOF? How can I jump to the RAM-area (in a different segment)?
Thanks for the help!
Best Regards, Josef Aspelmayr
I was in contact with Keil and according to Support-Team this is a compiler-issue and will be solved.
Seems like you've found a bug! Nice work (reporting it)!
I was thinking it might help to explicitly declare the fls_ram variable as huge/xhuge in the C file? To make sure it doesn't use near/DPP. But this would generate the same #SOF instruction I guess, not sure.
Regards, Joost Leeuwesteijn