Hi,
We faced an issue with your code in some special case when calculating overflow flag with your method.
Take any arbitrary positive number and 10000000000000000000000000000000. if these are the inputs of CMP or SUB commands, the overflow flag will be set to 0. However, it should be 1. This happens because neg of above number will equal itself, and cin and cout will both be zero.
Hi,
We faced an issue with your code in some special case when calculating overflow flag with your method.
Take any arbitrary positive number and
10000000000000000000000000000000. if these are the inputs of CMP or SUB commands, the overflow flag will be set to0. However, it should be1. This happens becausenegof above number will equal itself, andcinandcoutwill both be zero.