-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathAAS.htm
76 lines (60 loc) · 1.87 KB
/
AAS.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
73
74
75
76
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>80386 Programmer's Reference Manual -- Opcode AAS</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="AAM.htm"> AAM ASCII Adjust AX after Multiply</A><BR>
<B>next:</B><A HREF="ADC.htm"> ADC Add with Carry</A>
<P>
<HR>
<P>
<H1>AAS -- ASCII Adjust AL after Subtraction</H1>
<PRE>
Opcode Instruction Clocks Description
3F AAS 4 ASCII adjust AL after subtraction
</PRE>
<H2>Operation</H2>
<PRE>
IF (AL AND 0FH) > 9 OR AF = 1
THEN
AL := AL - 6;
AL := AL AND 0FH;
AH := AH - 1;
AF := 1;
CF := 1;
ELSE
CF := 0;
AF := 0;
FI;
</PRE>
<H2>Description</H2>
Execute AAS only after a
<A HREF="SUB.htm">SUB</A> instruction that leaves the byte result in the
AL register. The lower nibbles of the operands of the
<A HREF="SUB.htm">SUB</A> instruction must
have been in the range 0 through 9 (BCD digits). In this case, AAS adjusts
AL so it contains the correct decimal digit result. If the subtraction
produced a decimal carry, the AH register is decremented, and the carry and
auxiliary carry flags are set to 1. If no decimal carry occurred, the carry
and auxiliary carry flags are set to 0, and AH is unchanged. In either case,
AL is left with its top nibble set to 0. To convert AL to an ASCII result,
follow the AAS with <A HREF="OR.htm">OR</A> AL, 30H.
<H2>Flags Affected</H2>
AF and CF as described above; OF, SF, ZF, and PF are undefined
<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="AAM.htm"> AAM ASCII Adjust AX after Multiply</A><BR>
<B>next:</B><A HREF="ADC.htm"> ADC Add with Carry</A>
</BODY>