Question

I found list of intel 8086 commands and how every instruction affects flags (http://www.gabrielececchetti.it/Teaching/CalcolatoriElettronici/Docs/i8086_instruction_set.pdf).

The problem is that I have no idea what happens, if flag for certain instruction is undefined (marked as ?).

For example, if we set auxiliary flag as 1, and run XOR BX, A3BA, where BX is 04B7, auxiliary flag becomes zero after instruction execution. In the document, we can see that XOR marks auxiliary flag as undefined. So how to determine how flags change if they are undefined?

Was it helpful?

Solution

The flags are set based on the result of each instruction. Some flags (like the A flag) may not have any meaning for some instructions. It is meaningless to talk about a 4-bit carry (which is what the A flag indicates) when you're performing an instruction that doesn't involve 4-bit arithmetic.

Concern yourself with the flags that have meaning for the instruction you're executing and ignore the rest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top