1. BCD transfer move SMOV
1. BCD transfer move SMOV
1.1. Instruction Description
The instruction will first convert binary data (S) into BCD code, and then shift and transmit the BCD code to achieve data allocation and combination. The BCD code of the source data (S) is shifted from the (N1) th bit to the (N2) th bit starting from the (N3) th bit of the data (D), while the BCD codes of the other bits of the destination data (D) remain unchanged. Then, the BCD code in data (D) is automatically converted into a binary number, which is the content of data (D). An error occurred when the BCD code value exceeded 9999.
1.2. The valid operands of the instruction
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| SV | 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) | input |
| SS | 16 bit unsigned integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | input position |
| SC | 16 bit unsigned integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | length |
| DV | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | output |
| DS | 16 bit unsigned integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | output position |
1.3. Example
command table:
NETWORK 000
LDP M1
MOV K4321 D1
MOV K8888 D2
POP
LD M1
SMOV D1 K4 K2 D2 K3 //When M1 is' 1 ', the execution result D2=8438
图1 SMOV