Let's say I have an initial flag condition of z=0, n=0,c=1, q=0,v=0;
and the following registers r1=1000 0003 H r2=1000 0004 H
and have the following instruction: ADCS r1,r2
Would the r1 be 2000 0007 H with the new updated carry set which is zero or 2000 0008 H with the carry from the initial condition?
The old value of the carry flag is included in the addition, and it is set afterwards to indicate whether the new addition caused a carry. Following your example code, r1 will equal
20000008Hand the carry flag will be zero.The main point of an add-carry instruction is to be used in a loop to add multiple-precision integers one word at a time, propagating the carry through. So it can't really work any other way than this.
In general, for such questions, if a test is not enough to convince you, then refer to the ARM Architecture Reference Manual. They have detailed pseudocode for every instruction that defines precisely what it does. For this instruction they have
showing clearly that the value of the carry flag is used before being updated.