I wanted to ask that is there any explicit and easy way to store the values of flags such as(carry flag, auxiliary flag, parity flag, zero flag, overflow flag, signed flag etc.) in variables such as;
.data
carry_flag db 0
auxiliary_flag db 0
zero_flag db 0
I have researched a lot but couldn't find a way to "store" values of flags in a variable in 8086 processor. We can surely view the flags using any debugger such as AFD Debugger but what if we want to store them on run-time and show them to the user at the end of the program.
Please suggest an easy way to store the values of all such flags from flag register into variables in 8086 Assembly Language - MASM.
Thank you in advance!
PUSHF
: Push FLAGS Register onto the Stack – MikeCATAF
is bit #4 so you couldpop ax; shr al, 4; and al, 1; mov [auxiliary_flag], al
– Jestershr ah, 1;
and then:and ah, 1
and so on.. Shouldn't we do work with ah? as it is on the higher side (means right) – Hammad