3. Instruction Set

API

82

Mnemonic

 

Operands

Function

 

 

 

 

 

 

 

ASCI

 

P

 

Convert Hex to ASCII

 

 

 

 

 

 

Controllers

ES2/EX2 SS2 SA2 SX2

SE

Type

 

Bit Devices

 

 

 

 

 

Word devices

 

 

 

 

 

 

Program Steps

 

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

K

H

KnX

KnY

KnM

KnS

T

C

D

E

 

F

ASCI, ASCIP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

*

*

*

*

 

*

 

*

 

*

 

*

*

 

 

 

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

*

 

*

 

*

 

*

 

*

*

 

 

 

 

 

 

 

 

 

n

 

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16-bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

 

SE

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S: Source device

D: Destination device

 

n: Number of nibbles to be converted (n = 1~256)

 

Explanations:

1.16-bit conversion mode: When M1161 = OFF, the instruction converts every nibble of the Hex data in S into ASCII codes and send them to the higher 8 bits and lower 8 bits of D. n = the converted number of nibbles.

2.8-bit conversion mode: When M1161 = ON, the instruction converts every nibble of the Hex data in S into ASCII codes and send them to the lower 8 bits of D. n = the number of converted nibbles. (All higher 8 bits of D = 0).

3.Flag: M1161 (8/16 bit mode switch)

4.Available range for Hex data: 0~9, A~F

Program Example 1:

1.M1161 = OFF, 16-bit conversion.

2.When X0 = ON, convert the 4 hex values (nibbles) in D10 into ASCII codes and send the result to registers starting from D20.

M1001

M1161

X0

ASCI D10 D20 K4

3.Assume:

(D10)

= 0123 H

‘0’ = 30H

‘4’ = 34H

‘8’ = 38H

(D11) = 4567 H

‘1’ = 31H

‘5’ = 35H

‘9’ = 39H

(D12)

= 89AB H

‘2’ = 32H

‘6’ = 36H

‘A’ = 41H

(D13)

= CDEF H

‘3’ = 33H

‘7’ = 37H

‘B’ = 42H

3 - 2 2 7

Page 343
Image 343
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Convert Hex to Ascii, = Cdef H