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

c-variable definitions in assembly main

Hi,

I am programming on the Cypress FX2 (8051 compatible) and I have a problem that my variables declared in a c-function do not get initializes properly.

My main program is written in assembly, since I need to have an ISR, which is very short and i want to have full control over what the proc. does during that ISR. I have to include a c-file in my project, which initializes a bunch of registers for a special interface on my USB chip. The problem is that the linker does not include that data segment.

my data is defined this way:

const char xdata WaveData[128] = {128 bytes}

do i need to write an initialization function in C, which moves all that data or is there a way for force the inclusion of that data segment?

thanks,

Greg

ps.: sorry if i am not clear.

Parents
  • "since I need to have an ISR, which is very short and i want to have full control over what the proc. does during that ISR."

    I know there are situations where one has to resort to assembler, but why don't you try writing the ISR in C and take a look at the code generated? You might be pleasantly surprised. If you aren't already familiar with it check out the 'using' keyword for specifying register banks.

    Stefan

Reply
  • "since I need to have an ISR, which is very short and i want to have full control over what the proc. does during that ISR."

    I know there are situations where one has to resort to assembler, but why don't you try writing the ISR in C and take a look at the code generated? You might be pleasantly surprised. If you aren't already familiar with it check out the 'using' keyword for specifying register banks.

    Stefan

Children
No data