DABIN

DABIN, DABINP, DDABIN, DDABINP

 

DABIN instruction converts an ASCII code to a decimal value and saves the 16bit binary result in Destination (assigned device address).

  • DDABIN and DDABINP are Double Word (32bit).

 

 

S

Source (Decimal ASCII code)

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

DABIN(P)

DDABIN(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

-

 

DABIN(P)

The DABIN instruction converts an ASCII code to a decimal value and places the 16bit binary result in the Destination.

 

  • The range of Decimal data is -32768 ~ 32767.

  • If BIN data is +, sign is saved as 20H(space) and if BIN data is -, sign is saved as 2DH(-).

  • If the position of ASCII code is 20H and 00H each, it becomes 30H.

 

Example)

If the ASCII code of S is -25108, its decimal value is saved in D.

 

 

Example)

If X01 is ON, DABIN converts an ASCII code of D0~D2 to a decimal value and save the result -276 in D20.

 

 

DDABIN(P)

The DDABIN instruction converts 32bit ASCII code to a decimal value and places the result in the Destination.

 

  • The range of Decimal data is -2147483648 ~ 2147483647.

  • If BIN data is +, sign is saved as 20H(space) and if BIN data is -, sign is saved as 2DH(-).

  • The data in higher byte of S+5 is ignored.

  • If the position of ASCII code is 20H and 00H each, it becomes 30H.

 

Example)

If the ASCII code of S is -123454321, its decimal value is saved in D and D+1.

 

 

Example)

If X01 is ON, DDABIN converts an ASCII code of D0~D5 to a decimal value and save the result 3968730 in D20 and D21.