We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
Well, if SDCC doesn't have the feature then, presumably, none of your existing code uses it - so you don't need to worry about it at this point!
Start a separate, specific thread once you've got the basic port done.
you are wrong because it isn't just the hardware, it never is "just the hardware".
When one compiles a program in SDCC , he has to add a parameter which tells SDCC for what hardware SDCC is compiling. Than SDCC links the interrupts to the hardware addresses. But it is SDCC which does this for you. And I need to be able to it myself because of our FPGA chips. And this shouldn't be impossible.</i?
it is the interrupt addrsses are fixed in hardware.
www.danlhenry.com/.../80C51_FAM_ARCH_1.pdf www.danlhenry.com/.../80C51_FAM_HARDWARE_1.pdf www.danlhenry.com/.../80C51_FAM_PROG_GUIDE_1.pdf
the above will also educate you re register banks