forked from NJU-ProjectN/i386-manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DAS.htm
72 lines (55 loc) · 1.47 KB
/
DAS.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>80386 Programmer's Reference Manual -- Opcode DAS</TITLE>
</HEAD>
<BODY STYLE="width:80ch">
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="DAA.htm"> DAA Decimal Adjust AL after Addition</A><BR>
<B>next:</B><A HREF="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) > 9 OR AF = 1
THEN
AL := AL - 6;
AF := 1;
ELSE
AF := 0;
FI;
IF (AL > 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">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">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="DAA.htm"> DAA Decimal Adjust AL after Addition</A><BR>
<B>next:</B><A HREF="DEC.htm"> DEC Decrement by 1</A>
</BODY>