topic Compute eflags in IntelĀ® ISA Extensions
https://community.intel.com/t5/Intel-ISA-Extensions/Compute-eflags/m-p/871367#M2365
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.<BR /><BR />Sincerely,<BR /><BR />Hunter<BR />Tue, 17 Jun 2008 21:00:58 GMThunter1232008-06-17T21:00:58ZCompute eflags
https://community.intel.com/t5/Intel-ISA-Extensions/Compute-eflags/m-p/871367#M2365
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.<BR /><BR />Sincerely,<BR /><BR />Hunter<BR />Tue, 17 Jun 2008 21:00:58 GMThttps://community.intel.com/t5/Intel-ISA-Extensions/Compute-eflags/m-p/871367#M2365hunter1232008-06-17T21:00:58ZRe: Compute eflags
https://community.intel.com/t5/Intel-ISA-Extensions/Compute-eflags/m-p/871368#M2366
<P>Hunter,</P>
<P>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".</P>
<P>As for your example, ADD instruction produces carry (and thus sets CF) if an <A href="http://en.wikipedia.org/wiki/Adder_%28electronics%29" target="_blank">adder</A> inside of a CPU <A href="http://en.wikipedia.org/wiki/Arithmetic_logic_unit" target="_blank">ALU</A> produces carry as a result of addition operation.</P>
<P>I suggest you start with <A href="http://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29" target="_blank">Boolean algebra</A> (Boolean logic) if you are not familiar with this subject.</P>
<P>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 <A href="http://www.emulators.com/docs/nx10_bochs.htm" target="_blank">this article</A> onwards.</P>
<P>Let me know if this helps.</P>Mon, 28 Jul 2008 03:36:15 GMThttps://community.intel.com/t5/Intel-ISA-Extensions/Compute-eflags/m-p/871368#M2366ILevi12008-07-28T03:36:15Z