Can't figure out with the flag. The question is based on the example, why when getting a negative number in one case it is set, in the other there?
Example:
mov cx, 80h sub cx, 7FFFh ;cx = 8081h (Of = 0) mov cx, 80h sub cx, 8000h ;cx = 8080h (Of = 1) ; диапазон 8000h - 8080h дает флаг Of = 1 mov cx, 80h sub cx, 8080h ;cx = 8000h (Of = 1) ; далее Of = 0, результат положительный
CX. - Zealint