I am currently learning about arithmetic operations for Intel 8086 assembly language. I was trying to figure out manually after the below code what would the status of flat bits specially overflow flag and sign flag bit and why?
MOV AX, 0xFFFF ;
MOV BX, 0x0 ;
SUB BX,AX ;
Here as the number the stored value is in 2's complement stored in BX 0001H. What would be the status of sign and overflow flags! Also I am confused the 16th bit as stored in two's complement is zero. As the value stored in 2's complement is 0001H (in BX), it is out of range as decimal of it is -65535 being out of range of -32768 to 32767 (signed range for 16bit operation).So the overflow flag should be 1. And the sign flag should be 0 as the 16th bit is zero. But it shouldn't be the case as it is a negative number!