1. List reading SFRD/SFRDD/SFRDF
1. List reading SFRD/SFRDD/SFRDF
1.1. Instruction Description
The Single Character Read List (SFRD) instruction pops out the first element in the list and stores it in OUT. The Double Character Write List (SFRDD) reads double characters, and the Floating Point Write List (SFRDF) reads floating points.
After the first element in the list is popped up, all subsequent elements must be moved up one space.
For example, SFRD D10 D0 K5 reads the first element D11 at the beginning of the list and stores it in D0* When D10 (the number of data stored in the current list) is 0, the list is no longer read, that is, D0 retains the elements that were read last time (D10=1)*
图1 Read Single Word from List
SFRDD D10 D0 K5 reads the first element D12D13 at the beginning of the list and stores it in D0D1. At this time, it is important to note that the number of elements occupies two registers.
图2 List Read Double Words
SFRDF D10 D0 K5 reads the first element D12D13 at the beginning of the list and stores it in D0D1. At this time, it is important to note that the number of elements occupies two registers.
图3 List Read Floating
1.2. The valid operands of the instruction
1.2.1. List Read Single word(SFRD)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| T | 16 bit integer | D | List |
| V | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | new value |
| 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 Read Double Word(SFRDD)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| T | 32-bit integer | D | List |
| V | 32-bit integer | D/CV, bit composite word (Y/M/C/T/S), local variable (LD) | new value |
| 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 Read Floating(SFRDF)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| T | 32-bit Real Number | D | List |
| V | 32-bit real number | D, local variable (LF) | new value |
| 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
SFRD D10 D0 K10 // Pop up the first element of D10 and place it in D0.
图4 SFRD