BDIV (BCD)

 BDIV, BDIVP, DBDIV, DBDIVP (BCD)

 

BDIV instruction divides S1 by S2 and save the result in the Destination (assigned device address).

 

 

S1

Value of the dividend

S2

Value of the Divisor

D

Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

BDIV(P)

DBDIV(P)

S1

o

o

o

o

o

o

o

o

-

o

o

o

o

4

o

-

-

S2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

o

o

-

o

o

o

-

 

BDIV

When enabled, BDIV instruction divides S1(BCD value) by S2(BCD value) and saves the result to D and the remainder to D+1.

 

Example)

If X02 is ON, divide 1267(D0) by 26(D1) and save the result H0048 to Y20 and the remainder H0019 to Y30.