In: Electrical Engineering
What does the "S" suffix do when it is added to instructions in Arm architecture.
For example : ADDS RO, RO , R1
SUBS RO, RO, R1
Please feel free to use your own example. Thank you very much.
First of all S added to end of any instruction stands for APSR (Application Processor Status Register) will be updated depending on the outcome of the instruction.
Here flag will be updated according to the condition .
Here Negative(N) ,Carry (C) ,Zero (Z) and V(Overflow) flag will be updated after any operation .
Let R0=04H and R1 =05H
ADDS RO, RO , R1
=R0
Here Result is not equal to Zero So Z=0
No Carry operation is done ,So C=0
No overflow occurs V=0
The result is positive ,So negative flow N=0
If we use ADD instead of ADDS then result at R0 will be same but flag will not be updated .