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

sizeof to assembler

I use the following means of making .h files usable in assembler

#ifdef CCODE // bypass structs for assembler modules

structs ... such as

typedef struct
{
.........
} E1_SEI;

#endif
extern U8 ...
extern U16 ...
etc

this works very well.

Now, on occasion I am interested in assembler having access to sizeof E1_SEI

Currntly I have C code saving the size in a variable that the assembler reads, but that is ineffective and a "discrete" #define sizeofE1_SEI nnn is dangerous.

anyone found a way to do this?

Erik

Parents Reply Children
  • It would be --- but it's not, because doesn't actually work. The C preprocessor doesn't know about sizeof()

    I stated: "I have tried this one in order to get an error if wrong but get errors on it"

    thanks,

    I, evidently tried to do the impossible, so now I can leave it alone.

    However, since Keil does proudly state "you can use .h files in C" would it not be a desirable addition to this "nonstandard" functionality?

    Erik