Intel 80286, 80287 manual DAS-Decimal Adjust AL After Subtraction

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 247
Image 247

THE 80286 INSTRUCTION SET

DAS-Decimal Adjust AL After Subtraction

OpcodeInstruction ClocksDescription

2F

DAS

3

Decimal adjust AL after subtraction

FLAGS MODIFIED

Sign, zero, auxiliary carry, parity, carry

FLAGS UNDEFINED

Overflow

OPERATION

DAS should be executed only after a subtraction instruction which leaves a two-BCD-digit byte result in the AL register. The operands should consist of two packed BCD digits. In this case, the DAS instruction will adjust AL to contain the correct packed two-digit decimal result.

The precise definition of DAS is as follows:

1.If the lower four bits of AL are greater than 9, or if the auxiliary carry flag is 1, then decrement AL by 6, and set the auxiliary carry flag. Otherwise, reset the auxiliary carry flag.

2.If AL is now greater than 9FH, or if the carry flag is set, then decrement AL by 60H, and set the carry flag. Otherwise, clear the carry flag.

PROTECTED MODE EXCEPTIONS

None

REAL ADDRESS MODE EXCEPTIONS

None

8-37

Page 247
Image 247
Intel 80286, 80287 manual DAS-Decimal Adjust AL After Subtraction