Files
oldlinux-files/Ref-docs/manual Intel386/I386Manual/DAS.HTM
2024-02-19 00:21:47 -05:00

60 lines
2.0 KiB
HTML

<html><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>80386 Programmer's Reference Manual -- Opcode DAS</title>
</head>
<body>
<b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
<b>prev:</b><a href="DAA.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/DAA.HTM"> DAA Decimal Adjust AL after Addition</a><br>
<b>next:</b><a href="DEC.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/DEC.HTM"> DEC Decrement by 1</a>
<p>
<hr>
<p>
<h1>DAS -- Decimal Adjust AL after Subtraction</h1>
<pre>
Opcode Instruction Clocks Description
2F DAS 4 Decimal adjust AL after subtraction
</pre>
<h2>Operation</h2>
<pre>
IF (AL AND 0FH) &gt; 9 OR AF = 1
THEN
AL := AL - 6;
AF := 1;
ELSE
AF := 0;
FI;
IF (AL &gt; 9FH) OR (CF = 1)
THEN
AL := AL - 60H;
CF := 1;
ELSE CF := 0;
FI;
</pre>
<h2>Description</h2>
Execute DAS only after a subtraction instruction that leaves a two-BCD-digit byte result in the AL register. The operands should consist of two packed BCD digits. DAS adjusts AL to contain the correct packed two-digit decimal result.
<h2>Flags Affected</h2>
AF and CF as described above; SF, ZF, and PF as described in <a href="APPC.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/APPC.HTM">Appendix C</a>.
<h2>Protected Mode Exceptions</h2>
None
<h2>Real Address Mode Exceptions</h2>
None
<h2>Virtual 8086 Mode Exceptions</h2>
None
<p>
<hr>
<p><b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
<b>prev:</b><a href="DAA.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/DAA.HTM"> DAA Decimal Adjust AL after Addition</a><br>
<b>next:</b><a href="DEC.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/DEC.HTM"> DEC Decrement by 1</a>
</body>