This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

xPSR data not updated.

Dear all,
I am using the Keil 5.23 and running simulation for the STM32F103ZE

I am using optimization Level 0 (-O0)

In C, I have declared two variables i j
i = 0x12345678
j = 0x87654321

then I have 2 instructions in C

dummy = i + j;

dummy = i - j;

When I switch to Disassembly and looking to the disassembly code,

the register value

R2 = 0x12345678;
R3 = 0x87654321;
before executing the ADD r2,r2,r3 the XPSR shows

N = 1, Z = 0, C = 1, V = 0, Q = 0, T = 1;
After the ADD instruction, results remains the same..
However, from the addition, there should be NO Carry after the addition, why the status of the xPSR not updated ?

It would be grateful if I can get any help on that..
Thanks,
Yours
FOX

Parents
  • Dear Hans-Bernhard Broeker,

    Thanks for your statement of the job of the compiler and that would be informative to me.

    Like a compiler, it is free for you to think if I am not appreciating the other's work,
    however, I truly appreciate all the information I got from here.

    Thanks,
    Yours
    WU, Chi Hang

Reply
  • Dear Hans-Bernhard Broeker,

    Thanks for your statement of the job of the compiler and that would be informative to me.

    Like a compiler, it is free for you to think if I am not appreciating the other's work,
    however, I truly appreciate all the information I got from here.

    Thanks,
    Yours
    WU, Chi Hang

Children
No data