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.
There is a good tutorial on the four distinct register banks of an 8051 (in the "Register Banks" section)
www.8052.com/tutmemor.phtml
Unless you say otherwise, we use register bank 0, but you could reserve another of the register banks for a function, so you can always have its registers ready to go.
The compiler can even take advantage of this when you turn on "Global register coloring"
http://www.keil.com/support/man/docs/c51/c51_ap_opt_grc.htm
See the other function declaration extensions at:
http://www.keil.com/support/man/docs/c51/c51_le_funcdecls.htm
the most useful use of register banking is ISRs