Compute eflags

Compute eflags

Аватар пользователя hunter123

I am looking for a reputable resource which describes how instructions compute the results placed in various flags. I am *NOT* looking for information like "add affects cf,zf,sf,pf,of,af"; I need information like "add computes the value in cf by dividing the square root of DEST by the natural log of SRC". Given that x86 emulators exist, there must be such a resource, but I have been spectacularly unsuccessful in my searches. Any help would be appreciated.



2 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя Igor Levicki


Let me try to address your question. You have to understand what each flag means first and you have to have basic knowledge of electronics as well as Boolean algebra (Boolean logic), and then you will be able to understand how they are "computed".

As for your example, ADD instruction produces carry (and thus sets CF) if an adder inside of a CPU ALU produces carry as a result of addition operation.

I suggest you start with Boolean algebra (Boolean logic) if you are not familiar with this subject.

If you are mainly interested in emulation, and how emulators compute EFLAGS, please start reading those excellent EFLAGS emulation ideas presented by Darek Mihocka from this article onwards.

Let me know if this helps.

-- Regards, Igor Levicki If you find my post helpfull, please rate it and/or select it as a best answer where applies. Thank you.

Зарегистрируйтесь, чтобы оставить комментарий.