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

Can I use #ifdef in STARTUP.A51

My current project has 2 targets, For 1 the code starts at 0x0000 and for the other the code starts at 0x8000. I therefore modified STARTUP.A51 to give:

                PUBLIC  ?C_STARTUP
#ifdef TOP
                CSEG    AT      0x8000
#else
                CSEG    AT      0x0000
#endif

?C_STARTUP:     LJMP    STARTUP1

I have set the preprocessor define symbol to TOP under Options for Target/C51 for the target I want to start at 0x8000. When I look at the m51 file the LJMP to the STARTUP Code is always put at 0x0000.

However if i change STARTUP.A51 to give:
                PUBLIC  ?C_STARTUP

                CSEG    AT      0x8000

?C_STARTUP:     LJMP    STARTUP1

The LJMP to the STARTUP Code is now situated at 0x8000.

I therefore assume that the preprocessor directive #ifdef is being ignored.

Can anyone explain this?

0