<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic question about DAA(opcode 0x27) instruction's operation in Intel® ISA Extensions</title>
    <link>https://community.intel.com/t5/Intel-ISA-Extensions/question-about-DAA-opcode-0x27-instruction-s-operation/m-p/1031878#M5200</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm currently writing a x86 code emulator.&lt;/P&gt;

&lt;P&gt;So I need to know detailed instruction's operation.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I was writing a DAA instruction, detailed operation is like this,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;old_AL ← AL;&lt;BR /&gt;
	old_CF ← CF;&lt;BR /&gt;
	CF ← 0;&lt;BR /&gt;
	IF (((AL AND 0FH) &amp;gt; 9) or AF = 1)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;THEN&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AL ← AL + 6;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CF ← old_CF or (Carry from AL ← AL + 6);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AF ← 1;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ELSE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AF ← 0;&lt;BR /&gt;
	FI;&lt;BR /&gt;
	IF ((old_AL &amp;gt; &lt;STRONG&gt;99H&lt;/STRONG&gt;) or (old_CF = 1))&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;THEN&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AL ← AL + 60H;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CF ← 1;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ELSE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CF ← 0;&lt;BR /&gt;
	FI;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I'm just wondering about whether constant &lt;STRONG&gt;0x99&lt;/STRONG&gt; is correct or not.&lt;/P&gt;

&lt;P&gt;Somebody(from the internet) said &amp;nbsp;&lt;STRONG&gt;0x9F&lt;/STRONG&gt; was right, but the intel manual says &lt;STRONG&gt;0x99&lt;/STRONG&gt; is right.&lt;/P&gt;

&lt;P&gt;Which one is correct?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I need exactly answer from Intel&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;hardware engineering contacts.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2015 02:25:20 GMT</pubDate>
    <dc:creator>Gun_Woo_K_</dc:creator>
    <dc:date>2015-04-20T02:25:20Z</dc:date>
    <item>
      <title>question about DAA(opcode 0x27) instruction's operation</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/question-about-DAA-opcode-0x27-instruction-s-operation/m-p/1031878#M5200</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm currently writing a x86 code emulator.&lt;/P&gt;

&lt;P&gt;So I need to know detailed instruction's operation.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I was writing a DAA instruction, detailed operation is like this,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;old_AL ← AL;&lt;BR /&gt;
	old_CF ← CF;&lt;BR /&gt;
	CF ← 0;&lt;BR /&gt;
	IF (((AL AND 0FH) &amp;gt; 9) or AF = 1)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;THEN&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AL ← AL + 6;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CF ← old_CF or (Carry from AL ← AL + 6);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AF ← 1;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ELSE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AF ← 0;&lt;BR /&gt;
	FI;&lt;BR /&gt;
	IF ((old_AL &amp;gt; &lt;STRONG&gt;99H&lt;/STRONG&gt;) or (old_CF = 1))&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;THEN&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;AL ← AL + 60H;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CF ← 1;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ELSE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CF ← 0;&lt;BR /&gt;
	FI;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I'm just wondering about whether constant &lt;STRONG&gt;0x99&lt;/STRONG&gt; is correct or not.&lt;/P&gt;

&lt;P&gt;Somebody(from the internet) said &amp;nbsp;&lt;STRONG&gt;0x9F&lt;/STRONG&gt; was right, but the intel manual says &lt;STRONG&gt;0x99&lt;/STRONG&gt; is right.&lt;/P&gt;

&lt;P&gt;Which one is correct?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I need exactly answer from Intel&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;hardware engineering contacts.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 02:25:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/question-about-DAA-opcode-0x27-instruction-s-operation/m-p/1031878#M5200</guid>
      <dc:creator>Gun_Woo_K_</dc:creator>
      <dc:date>2015-04-20T02:25:20Z</dc:date>
    </item>
    <item>
      <title>If the threshold value is 9FH</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/question-about-DAA-opcode-0x27-instruction-s-operation/m-p/1031879#M5201</link>
      <description>&lt;P&gt;If the threshold value is 9FH, that meant an input value of 9AH will become A0H, which is not a packed BCD value in one byte.&lt;/P&gt;

&lt;P&gt;With the threshold value of 99H, 9AH will be adjusted by DAA into 00H, which is the wrapped result one would expect out of 1 byte packed BCD.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 21:30:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/question-about-DAA-opcode-0x27-instruction-s-operation/m-p/1031879#M5201</guid>
      <dc:creator>SHIH_K_Intel</dc:creator>
      <dc:date>2015-05-14T21:30:44Z</dc:date>
    </item>
  </channel>
</rss>

