SCL
SCL, SCLP, DSCL, DSCLP
SCL instruction scales number of source according to condition of T and saves the scaled value to the Destination.
| |
S | Source |
D | Destination |
P | Scale condition Table |
n | Number of data to scale |
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. | Error | Zero | Carry | |||
SCL(P) DSCL(P) | S | o | o | o | o | o | o | o | o | - | o | o | o | o | 5 | o | - | - |
D | o | - | o | o | o | - | - | - | - | o | o | o | - | |||||
P | o | - | - | o | o | - | - | - | - | o | o | o | - | |||||
n | o | o | o | o | o | o | o | o | - | o | o | o | o |
SCL
SCL instruction scales number of word source according to condition of P and saves the scaled value to the Destination.
Scale condition (P)
P | Minimum value of source to be scaled (Start Source) |
P + 1 | Maximum value of source to be scaled (Last Source) |
P + 2 | Scaled minimum value of destination (Start Dest.) |
P + 3 | Scaled maximum value of destination (Last Dest.) |
DSCL
DSCL instruction scales number of double word source according to condition of P and saves the scaled value to the Destination.
Scale condition (P)
P, P + 1 | Minimum value of source to be scaled (Start Source) |
P + 2, P + 3 | Maximum value of source to be scaled (Last Source) |
P + 4, P + 5 | Scaled minimum value of destination (Start Dest.) |
P + 6, P + 7 | Scaled maximum value of destination (Last Dest.) |
Reference
Scale formula
Destination = Source x Gradient(2) + Offset(3)
Gradient =
Offset (Y intercept) = Last Dest. – Gradient(2) x Last source |
Scale graph
Scale Range
If the source data is out of range, its value becomes the maximum and minimum value of Destination.
Source 1 is scaled to Starting value of destination and Source 2 is scaled to Last value of destination.
If the last source is less than starting source and the last destination is less than starting destination, its scaled value is opposite. (In case that Gradient has minus (-) value)
Example)
If X00 is ON, SCL instruction scales 10 words (D0~D9) according to scale condition (D200 to D203) and saves the scaled value to D100~D109.
Scale condition
D200 | 0 : minimum value of source |
D201 | 160000 : maximum value of source |
D202 | 1000 : minimum scaled value |
D203 | 5000 : maximum scaled value |