I have a local variable uint16_t* buf pointing to CPU1 to CPU2 Message RAM. The code is executed on CPU2 from RAM. I want to interpret first two elements of buf[ ] as uint32_t, so I wrote in C:
address = *((uint32_t*)buf);
But unfortunatelly I got unexpected result in the local variable "uint32_t address". I started debugging and stumbled over some unexpected behavior, that I can't understand. The code above was compiled to the following sequence of assembler instructions:
MOVL ACC,*+XAR4[0] ; [CPU_ALU] |204|
MOVL *-SP[4],ACC ; [CPU_ALU] |204|
But running this code step by step I get strange results. It seems to me that first instruction is executed wrong. Here is a screenshot before execting first instruction:

Here is screenshot after "Assembly step into":

I expected that ACC register will contain 0x082000 after executing first assembly instruction, but it contains 0x20000081. How can it be possible ?
Regards,
Alex