BCDDA

BCDDA, BCDDAP, DBCDDA, DBCDDAP

 

BCDDA instruction converts a BCD value to an ASCII code and saves the result in Destination (assigned device address).

  • DBCDDA and DBCDDAP are Double Word (32bit).

 

 

S

Source (BCD)

D

Starting device address of the Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

BCDDA(P)

DBCDDA(P)

S

o

o

o

o

o

o

o

o

-

o

o

o

o

3

o

-

-

D

o

-

o

o

o

-

o

o

-

o

o

o

-

 

BCDDA(P)

The BCDDA instruction converts a BCD value to an ASCII code and places the result in the Destination.

 

  • The range of BCD data is 0 ~ 9999.

  • The 0  is saved as 20H.

 

  • The 0  is saved in D+2.

 

 

Example)

If the S value is 9105, its ASCII code is saved in D~D+1.

 

 

DBCDDA(P)

The DBCDDA instruction converts 32bit BCD to an ASCII code and places the result in the Destination.

 

  • The range of 32bit BCD data is 0 ~ 99999999.

  • The 0  is saved as 20H.

 

  • The 0 is saved in D+4.

 

Example)

If the S value is 01234056, its ASCII code is saved in D~D+3.

 

Example)

If X01 is ON, BCDDAP converts a BCD value of D0 to an ASCII code and save the result in Y00.