1. List writing SFWR/SFWD/SFWF

1. List writing SFWR/SFWD/SFWF

1.1. Instruction Description

The Single Word Write List (SFWR) instruction adds the input single word to the list structure. The Double Word Write List (SFWRD) writes double words, while the Floating Point Write List (SFWRF) writes floating points.

A list consists of n elements plus n elements. For single word lists, n occupies one single word register, while for double word and floating-point lists, n occupies two registers to store them as double words. Ensure that the total length of the list structure does not exceed the given limit.

For example, SFWR K100 D10 K5 writes the word 100 into a list starting with D10. The space occupied by the list will not exceed the range of D [10... 14].

List Write Single Word

图1 List Write Single Word

SFWRD K123456 D10 K5, write the doubleword 123456 into the list starting with D10, paying attention to the number of elements occupying two registers. The space occupied by the list will not exceed the range of D [10... 19].

List Write Double Word

图2 List Write Double Word

SFWRF K1.23 D10 K5, write floating point 1.23 into the list starting with D10, paying attention to the number of elements occupying two registers. The space occupied by the list will not exceed the range of D [10... 19].

List Write Floating

图3 List Write Floating

1.2. The valid operands of the instruction

1.2.1. List Write Single Word(SFWR)

Input/Output Data Type operand Description
V 16 bit integer D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) new value
T 16 bit integer D List
LEN 16 bit integer D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) length

1.2.2. List Write Double Word(SFWRD)

Input/Output Data Type operand Description
V 32-bit integer D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) new value
T 32-bit integer D List
LEN 16 bit integer D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) length

1.2.3. List Write Floating(SFWRF)

Input/Output Data Type operand Description
V 32-bit real number D/K/FD, local variable (LF) new value
T 32-bit Real Number D List
LEN 16 bit integer D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) length

1.3. Example

Command table:

NETWORK 000

LDP X000

SFWR K100 D10 K10 // Add K100 to the list maintained starting from D10

SFWR

图4 SFWR