CW 7.2 Bug compiling constant 0x44000000 translates into 0x10000000

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CW 7.2 Bug compiling constant 0x44000000 translates into 0x10000000

跳至解决方案
1,283 次查看
nnadal2
Contributor III

Compiling a file outside the 'drivers' folder in one case 0x44000000 is translated into 0x10000000

 

;   79:         (*(volatile vuint32 *)(0x44000000+address)) =  -1;
;
0x00000028  0x207C44000000           movea.l  #1140850688,a0        ; 'D...'
0x0000002E  0x74FF                   moveq    #-1,d2
0x00000030  0x21827800               move.l   d2,(a0,d7.l)
;

...
;  114:        (*(volatile vuint32 *)(0x44000000+dst_cpyflash)) =  data;
;  115:               
;
0x000000DA  0x2E3900000000           move.l   _dst_cpyflash,d7
0x000000E0  0x068710000000           addi.l   #268435456,d7         ; '....'    <<<<<--translated to 0x10000000
0x000000E6  0x2047                   movea.l  d7,a0
0x000000E8  0x2082                   move.l   d2,(a0)

 

Coldwarrior Version 7.2 build 91218

 

Narcís Nadal

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,084 次查看
nnadal2
Contributor III

Solved with a cast  (int)

 

;  116:        (*(volatile vuint32 *)(0x44000000+(int)dst_cpyflash)) =  data;
;  117:         
;
0x000000DA  0x2E3900000000           move.l   _dst_cpyflash,d7
0x000000E0  0x207C44000000           movea.l  #1140850688,a0        ; 'D...'    <<- now 0x44000000 is translated correctlly
0x000000E6  0x21827800               move.l   d2,(a0,d7.l)

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,085 次查看
nnadal2
Contributor III

Solved with a cast  (int)

 

;  116:        (*(volatile vuint32 *)(0x44000000+(int)dst_cpyflash)) =  data;
;  117:         
;
0x000000DA  0x2E3900000000           move.l   _dst_cpyflash,d7
0x000000E0  0x207C44000000           movea.l  #1140850688,a0        ; 'D...'    <<- now 0x44000000 is translated correctlly
0x000000E6  0x21827800               move.l   d2,(a0,d7.l)

0 项奖励
回复