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

syntax changes from SDCC to KEIL

I am currently in the process of porting my C program from SDCC to Keil because of several reasons. (bugs, lack of support, limitations)

What I would like to know is how some of the syntax changes look like.

So far I have figured out that __xdata becomes xdata and I cannot enter binary values.

I am having a lot of issues with the keil compiler at the moment so I will keep it short.

The special functions registers look like:
__sfr __at 0xE0 ACC ;

I believe this must look like:
sfr ACC = 0xE0;
correct?

And is the same true for sbit?

__sbit __at 0x88 IT0 ; --> sbit IT0 = 0x88; ???

Than I'd like to know how the interrupt syntax looks like.
It currently looks like this:
void ISR_ex0(void) __interrupt 0

A huge problem we're having is that this interrupt 0 in SDCC is linked to a certain stack address (0x03). In SDCC I have no control over the link between address and interrupt numbers. This is baked in the compiler. I am programming an emulated 80c51 chip. The 'chip' is emulated on an FPGA and it comes with a lot of extras such as extra timers, 4 more I/O ports and 8 I/O interrupts rather than two. Now I can only use 2/8 interrupts.