this is the pre-processor output:
*(volatile uint32 *)(((void *)&((uint8 *)imm)[(0x0090)])) = (0x00070001) ;
and this is the resulting object code:
0x000000CE 0x206F0004 movea.l 4(a7),a0
0x000000D2 0x203C00070001 move.l #458753,d0 ; '....'
0x000000D8 0x21400120 move.l d0,288(a0)
Note that the offset of 0x120 in the last move.l is the same as (0x90 << 1).
Hello
Which version of CodeWarrior are you using?
I am using CodeWarrior for Coldfire V6.2 and disassembling following source code
typedef unsigned long uint32;
typedef unsigned char uint8;
char imm[80];
int main()
{
*(volatile uint32 *)(((void *)&((uint8 *)imm)[(0x0090)])) = (0x00070001) ;
gives following code:
0x00000000 _main:
; main:
0x00000000 0x4E560000 link a6,#0
;
; 17: *(volatile uint32 *)(((void *)&((uint8 *)imm)[(0x0090)])) = (0x00070001) ;
; 18:
; 19:
; 20:
;
0x00000004 0x41F900000000 lea _imm,a0
0x0000000A 0x203C00070001 move.l #458753,d0 ; '....'
0x00000010 0x21400090 move.l d0,144(a0)
;
Which looks correct.
CrasyCat
Hello
It looks like you are using a beta version of the Coldfire tools.
The official CodeWarrior for Coldfire V6.0 had build number 10. You are using build number 8.
Official release of CodeWarrior for Coldfire V6.0 Build 10 is also generating following code:
0x00000004 0x41F900000000 lea _imm,a0
0x0000000A 0x203C00070001 move.l #458753,d0 ; '....'
0x00000010 0x21400090 move.l d0,144(a0)
;
So I would kindly ask you to install an official version of the tool.
CrasyCat
Daniel,
the macros I've shown do compile, but the offsets weren't correct (as far as I could tell). What were your results?
Where does one find the preprocessor output? I am running CW 6.0. I can provide my project file if that would be of any help.
Thanks,
Joe