3. Instructions
1088
CS/CJ/NSJ Series Instructions Reference Manual (W474)
LEFT$/RGHT$
Applicable Program Areas
Operands
S1: Text String D: First Destination Word
S2: Number of Characters
0000 to 0FFF hex or &0 to &4095
Note • The data from S1 to S1 + the maximum 2,047 words and from D to D + the maximum 2,047 words must be in the
same area.
• The data from S1 to S1 + the maximum 2,047 words and from D to D + the maximum 2,047 words can overlap.
Operand Specifications
Instruction Mnemonic Variations
Function
code
Function
GET STRING LEFT LEFT$ @LEFT$ 652
Fetches a designated number of characters from
the left (beginning) of a text string.
GET STRING RIGHT RGHT$ @RGHT$ 653
Reads a designated number of characters from
the right (end) of a text string.
Symbol
LEFT$ RGHT$
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or transition
programs
Usage OK OK OK OK OK OK
Operand Description Data type Size
S1 Text string first word UINT Variable
S2 Number of characters UINT 1
D First destination word UINT Variable
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
S1
OK OK OK OK OK OK OK OK OK OK
--- ---
--- OK --- --- --- ---S2 OK OK
D --- ---
S1: Text string first word
S2: Number of characters
D: First destination word
LEFT$(652)
S1
S2
D
S1: Text string first word
S2: Number of characters
D: First destination word
RGHT$(653)
S1
S2
D
15 0
S1
to to
Text string data: 4,095 characters max. + NUL
S1 + maximum 2,047 words
15 0
D
to to
Text string data: 4,095 characters max. + NUL
D + maximum 2,047 words