Make your own free website on Tripod.com
Up ] Docs Home ]

DAS - Decimal Adjust AL after Subtraction

Back ] Next ]

*

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

?


Code Mnemonic Description
2F DAS Decimal adjust AL after subtraction

Description
Adjusts the result of the subtraction of two packed BCD values to create a packed BCD result. The AL register is the implied source and destination operand. The DAS instruction is only useful when it follows a SUB instruction that subtracts (binary subtraction) one 2-digit, packed BCD value from another and stores a byte result in the AL register. The DAS instruction then adjusts the contents of the AL register to contain the correct 2-digit, packed BCD result. If a decimal borrow is detected, the CF and AF flags are set accordingly.
Operands Bytes Clocks
1 3 NP

Flags
ID unaffected DF unaffected
VIP unaffected IF unaffected
VIF unaffected TF unaffected
AC unaffected SF sets according to the result
VM unaffected ZF sets according to the result
RF unaffected AF sets if the adjustment of the value results in a decimal borrow in either digit of the result
NT unaffected PF sets according to the result
IOPL unaffected CF sets if the adjustment of the value results in a decimal borrow in either digit of the result
OF undefined