In article <87490@palm-dev-forum>, [EMAIL PROTECTED] says...
> 
> Palm Developer Forum      Hi,Everybody,this is my first Question,Please give me  
>advice.thanks in advance!
>       Compiler:CodeWarrior ,when using "view  memory",I find  something strange:
>       For Example: Memory display
> 
>        0x00F00000:   0011 0022 0033 0044  .....
>        ........       ....  ..  ...  ..
> 
>   assume a WORD pointer to 0x00F0000 :
>       WORD*   wT;       ;  I can watch its value equal 0x0011,and wT+1 's value is 
>0x0022
>                                         ;
>   next   assume a DWORD pointer to  0x00F00000:
>       DWORD*  dwT;            ; I can watch its value equal 0x00110022
> 
>  Originally  data "0x0022" 's address is higher than data "0x0011" ,but DWORD (or 
>UInt32)
>  make it changed.

You do realize that the byte order on a Palm OS device is reversed from 
how its ordered on a PC with an x86 processor?

A 32-bit value of 0x22001100 in memory on the x86 is represented as

0x00, 0x11, 0x00, 0x22

but on the 68K, it is arranged as

0x22, 0x00, 0x11, 0x00

On a PC, you could compare the same address as a WORD * and a DWORD * 
and see the same low bytes for each pointers, but on the 68K, casting a 
DWORD * to a WORD * will give you a pointer to the high word of the 
value, not the low word.

-- 
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Get help at http://palmoswerks.com/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to