Intel 80C188XL Instruction Set Descriptions, Table C-4.Instruction Set Continued, C-13, Name

Models: 80C186XL 80C188XL

1 405
Download 405 pages 42.62 Kb
Page 336
Image 336
Divide:

INSTRUCTION SET DESCRIPTIONS

Table C-4. Instruction Set (Continued)

Name

Description

Operation

Flags

Affected

 

 

 

 

 

 

 

DIV

Divide:

When Source Operand is a Byte:

AF ?

 

DIV src

(temp) (byte-src)

CF ?

 

Performs an unsigned division of the

if

DF –

 

IF –

 

(temp) / (AX) > FFH

 

accumulator (and its extension) by the

 

OF ?

 

then (type 0 interrupt is generated)

 

source operand.

 

PF ?

 

(SP) (SP) – 2

 

If the source operand is a byte, it is

 

((SP) + 1:(SP)) FLAGS

SF ?

 

divided into the two-byte dividend

(IF) 0

TF –

 

assumed to be in registers AL and AH.

(TF) 0

ZF ?

 

The byte quotient is returned in AL,

(SP) (SP) – 2

 

 

and the byte remainder is returned in

 

 

((SP) + 1:(SP)) (CS)

 

 

AH.

 

 

(CS) (2)

 

 

If the source operand is a word, it is

 

 

(SP) (SP) – 2

 

 

divided into the two-word dividend in

((SP) + 1:(SP)) (IP)

 

 

registers AX and DX. The word

(IP) (0)

 

 

quotient is returned in AX, and the

else

 

 

word remainder is returned in DX.

(AL) (temp) / (AX)

 

 

If the quotient exceeds the capacity of

(AH) (temp) % (AX)

 

 

its destination register (FFH for byte

When Source Operand is a Word:

 

 

source, FFFFH for word source), as

(temp) (word-src)

 

 

when division by zero is attempted, a

 

 

if

 

 

type 0 interrupt is generated, and the

 

 

(temp) / (DX:AX) > FFFFH

 

 

quotient and remainder are undefined.

 

 

then (type 0 interrupt is generated)

 

 

Nonintegral quotients are truncated to

 

 

(SP) (SP) – 2

 

 

integers.

 

 

((SP) + 1:(SP)) FLAGS

 

 

Instruction Operands:

 

 

(IF) 0

 

 

DIV reg

(TF) 0

 

 

DIV mem

(SP) (SP) – 2

 

 

 

((SP) + 1:(SP)) (CS)

 

 

 

(CS) (2)

 

 

 

(SP) (SP) – 2

 

 

 

((SP) + 1:(SP)) (IP)

 

 

 

(IP) (0)

 

 

 

else

 

 

 

(AX) (temp) / (DX:AX)

 

 

 

(DX) (temp) % (DX:AX)

 

 

 

 

 

NOTE: The three symbols used in the Flags Affected column are defined as follows:

the contents of the flag remain unchanged after the instruction is executed ¸? the contents of the flag is undefined after the instruction is executed

the flag is updated after the instruction is executed

C-13

Page 336
Image 336
Intel 80C188XL Instruction Set Descriptions, Table C-4.Instruction Set Continued, C-13, Name, Operation, Flags, Affected