Hi all! I am experiencing the following problem:
sizeof(EDA.stPARAM) returns 0x80 with CA.exe V2.41 which in my opinion is the correct result, but with CA.exe V2.50a it returns 0x82. Can somebody explain this behaviour to me? Code sample is included below:
file eda_st.inc:
struct {
byte ubFree_0000h[16] ;/* 000h-00Fh: */
byte ubFree_0010h[16] ;/* 010h-01Fh: */
byte ubFree_0020h[16] ;/* 020h-02Fh: */
byte ubFree_0030h[16] ;/* 030h-03Fh: */
byte ubFree_0040h[16] ;/* 040h-04Fh: */
byte ubFree_0050h[16] ;/* 050h-05Fh: */
byte ubFree_0060h[16] ;/* 060h-06Fh: */
byte ubFree_0070h[16] ;/* 070h-07Fh: */
}stPARAM;
byte VER_HWVers ;/* 000h: */
byte ubFree_0000h[127] ;/* 001h-07fh: */
}stABGLEICH;
---------------------- file eda_usr.h:
typedef struct {
#include "eda_st.inc" // struct mit Parametern
} EDA_sttyDAT;
extern EDA_sttyDAT EDA;
---------------------- file eda_usr.c:
#define TAR_RAMCOPY 0x40001000
EDA_sttyDAT EDA __at(TAR_RAMCOPY);// RAM-Kopie
Not only embedded compilers.
Most compilers has it, since most C/C++ compilers are intended to allow systems programming. In some situations it is faster to use packet data structures instead of having to write the data byte-for-byte when writing graphics drivers or TCP/IP stacks etc.