Atari Logo
Atari Computer

Hauptseite -
Welches System? -
Hardware -
Software -
Emulatoren -
Internet
MausNet
Programmieren
Verweise
Über

Assembler

Previous Next TOC

NAME DIVU, DIVUL -- Unsigned divide
SYNOPSIS
DIVU.W<ea>,Dn32/16 -> 16r:16q
DIVU.L<ea>,Dq32/32 -> 32q(68020+)
DIVU.L<ea>,Dr:Dq64/32 -> 32r:32q(68020+)
DIVUL.L<ea>,Dr:Dq32/32 -> 32r:32q(68020+)
Size = (Word, Long)
FUNCTION Divides the unsigned destination operand by the unsigned source operand and stores the unsigned result in the destination.

The instruction has a word form and three long forms. For the word form, the destination operand is a long word and the source operand is a word. The resultant quotient is placed in the lower word of the destination and the resultant remainder is placed in the upper word of the destination. The sign of the remainder is the same as the sign of the dividend.

In the first long form, the destination and the source are both long words. The quotient is placed in the longword of the destination and the remainder is discarded.

The second long form has the destination as a quadword (eight bytes), specified by any two data registers, and the source is a long word. The resultant remainder and quotient are both long words and are placed in the destination registers.

The final long form has both the source and the destination as long words and the resultant quotient and remainder as long words.

FORMAT In the case of DIVU.W:
1514131211109876543210
1000REGISTER011MODEREGISTER
~<ea>
"REGISTER" indicates the number of data register.

In the case of DIVU.L and of DIVUL.L:
1514131211109876543210
0100110001MODEREGISTER
0Dq REGISTER0SIZE0000000Dr REGISTER
~<ea>

"Dq REGISTER" indicates the number of data register for destination operand. This register first contains 32 bits of low weight of dividend, and after the value of quotient on 32 bits.

"SIZE" specifies if dividend is on 32 or 64 bits:
0-> 32 bits dividend placed in Dq.
1-> 64 bits dividend placed in Dr:Dq.

"Dr REGISTER" indicates the number of data register for destination operand. This register first contains 32 bits of upper weight of dividend if "SIZE" = 1, and after the value of rest on 32 bits.

If Dr and Dq represents the same register, only quotient on 32 bits is put in Dq.

<ea> field specifies source operand, allowed addressing modes are:
Addressing ModeModeRegister
Dn000No reg. Dn
An--
(An)010No reg. An
(An)+011No reg. An
-(An)100No reg. An
(d16,An)101No reg. An
(d8,An,Xi)110No reg. An
(bd,An,Xi)110No reg. An
([bd,An,Xi]od)110No reg. An
([bd,An],Xi,od)110No reg. An
Addressing ModeModeRegister
Abs.W111000
Abs.L111001
(d16,PC)111010
(d8,PC,Xi)111011
(bd,PC,Xi)111011
([bd,PC,Xi],od)111011
([bd,PC],Xi,od)111011
#data111100

RESULT
X-Not affected
N-See below.
Z-Set if the quotient is zero, cleared otherwise. Undefined if overflow or divide by zero occurs.
V- Set if overflow occurs, cleared otherwise. Undefined if divide by zero occurs.
C-Always cleared.

Notes:

  1. If divide by zero occurs, an exception occurs.
  2. If overflow occurs, neither operand is affected.

According to the Motorola data books, the N flag is set if the quotient is negative, but in an unsigned divide, this seems to be impossible.


Best viewed with any browser English version not yet available.

Änderungen und Irrtümer vorbehalten. Letzte Änderung:
14 September 2001.
Home - Mail an den Webmaster - Impressum