beautypg.com

Applicable program areas operands, 2 instructions, Di: digit designator – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 237: S: source word d: first destination word

background image

2-201

2 Instructions

CP1E CPU Unit Instructions Reference Manual(W483)

Con

v

e

rs

ion I

n

stru

ctio

ns

2

ASC

ASC

Applicable Program Areas

Operands

DI: Digit Designator

The digit designator specifies various parameters for the conversion, as shown in the following dia-
gram.

Instruction

Mnemonic

Variations

Function

code

Function

ASCII CONVERT

ASC

@ASC

086

Converts 4-bit hexadecimal digits in the source
word into their 8-bit ASCII equivalents.

Symbol

ASC

Area

Step program areas

Subroutines

Interrupt tasks

Usage

OK

OK

OK

Operand

Description

Data type

Size

S

Source word

UINT

1

DI

Digit designator

UINT

1

D

First destination word

UINT

Variable

S: Source Word

D: First Destination Word

Note The destination words must be in the same

data area.

S: Source word

DI: Digit designator

D: First destination word

ASC(086)

S

DI

D

S

Digit 3

Digit 2

8

11

12

15

Digit 1

Digit 0

0

3

4

7

Digits from the starting digit of conversion going
left are treated as HEX data and converted to
ASCII code (returns to digit 0 after digit 3)

D

D+1

D+2

8

15

Leftmost byte

Rightmost byte

0

7

ASCII code is stored in the left word side. The
code is stored from the output starting byte of
D in the order rightmost byte, leftmost byte.

Leftmost byte

Rightmost byte

Leftmost byte

Rightmost byte

Specifies the first digit in S to be converted (0 to 3).

Number of digits to be converted (0 to 3)

0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits

First byte of D to be used.

0: Rightmost byte
1: Leftmost byte

Parity 0: None

1: Even
2: Odd

Digit number: 3 2 1 0

This manual is related to the following products: