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

C166: Call-segmented to a ram-address does not work

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