I am generating ROM tables, but the overall address table needs to use only lower 16 bits of the 32 bit pointer.
CodeWarrior 6.2 for Coldfire.
typedef struct {
unsigned char command;
unsigned char data;
unsigned char flag;
} TableDefType;
const TableDefType Table1[]= {
// some data...
};
const TableDefType Table2[]= {
// some data...
};
const char * Addresses[] = {
(const char*)&Table1, // these need to be 16 bit pointers
(const char*)&Table2,
};
I have also tried making the above table an array of 'short's, but the compiler won't convert the pointers.
Is there a low() pre-processor function?
If not, is there any other way to accomplish this?
Karl
Thanks for the reply.
It's Codewarrior Development Studio for Microcontrollers V6.2
The reason is historic. There are language and printer tables that were 'compiled' (no code, just tables) using an 8 but compiler which I didn't have. I was trying to used CW for this task, and other than the 16/32 bit pointer issue, I was sucessful. I have used other compilers in the past that had some kind of built-in function to get the parts of an otherwise larger object. EI: low(object), or high(object).
Karl
Hello
What are you attempting to do here?
Pointer are always encoded on 32-bit on Coldfire MCU. Why are you looking for 16-bit pointers?
Additionally which version of CodeWarrior are you using?
CodeWarrior for Coldfire V6.2 or CodeWArrior for MCU V6,2?
To retrieve that info:
- Start the IDE
- Select Help -> About Freescale CodeWarrior
- Click on Installed Products
- You should see in the dialog which product you are using.
CrasyCat