My Question is regarding the assembly Language programming for a project i am going to deliver to Professor Aghazarian ... There goes the Question: Why is it that the Increment and/or the Decrement instructions have no change nor effect over the carry flag ?!
Asked
Active
Viewed 1,549 times
-4
-
3Already answered here: http://stackoverflow.com/questions/13435142/why-the-inc-and-dec-instructions-do-not-affect-the-carry-flag – Alan Wolfe May 17 '15 at 16:50
-
1This is simply by design, and is useful when writing loops for carrying out arbitrary precision arithmetic. – Daniel Kamil Kozar May 17 '15 at 17:43
1 Answers
-1
Think of it like this, you wish to add two binary values together:
1111
1111
This if you add these together it will trigger the carry flag, as adding two 1's together in a register will write a 0 at the registers position and will carry over a 1. Thus setting the carry flag to 1.
Inc/Dec instructions will just increment and decrement a value stored in a register.
Unless an overflow occurs from the incrementing, this will also set the carry flag.

Rami
- 37
- 1
- 1
- 9
-
1Which - if I'm not mistaken - can also overflow and logically should also set the carry flag. So unless I'm mistaken that cannot be the complete answer, can it? – David van Driessche May 17 '15 at 16:54
-