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
I would appreciate a person without any diploma or certificates but experienced on their field who can give me insight to solve problems.
You say that, but I don't really see you doing so. You've rather consistently been ignoring all the insight offered to you --- often in the same post in which you claim to have understood and accepted it.
So hopefully for the last time, let me put it strongly, but simply: you keep asking the wrong questions, because those questions are based on a colossal misunderstanding of what the job of a compiler is.
The job of the compiler is to generate machine code that does the work described by the actual source code. It's entirely up to the compiler to decide how it does that. Any and all hard expectations regarding the compiler's decisions are wrong. Of course you could run all kind of experiments to see what happens if you do "this", as opposed to "that", but that would be an exercise in futility, because the results will be largely unreliable.
And to top it off, said misunderstanding is quite typical of total greenhorns who have never used a high-level language before. That's what worries us so, as we see it manifest in a person who plans to teach this stuff.
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