665
Data Control Instructions Section 3-17
Description For the first N–1 cycles when the execution condition is ON, AVG(195) writes
the values of S in order to words starting with R+2. The Previous Value
Pointer (bits 00 to 07 of R+1) is incremented each time a value is written. Until
the Nth value is written, the contents of S will be output unchanged to R and
the Average Value Flag (bit 15 of R+1) will remain OFF.
When the Nth value is written to R+N+1, the average of all the values that
have been stored will be computed, the average will be output to R as an
unsigned binary value, and the Average Value Flag (bit 15 of R+1) will be
turned ON. For all further cycles, the value in R will be updated for the most
current N values of S.
The maximum value of N is 64. If more than 64 cycles are specified, the set-
ting will be treated as 64 cycles.
The Previous Value Pointer will be reset to 0 after N–1 values have been writ-
ten.
The average value output to R will be rounded to the nearest integer.
Flags
DM Area D0 to D32767
Indirect DM addresses
in binary
@ D0 to @ D32767
Indirect DM addresses
in BCD
*D0 to *D32767
Constants #0000 to #FFFF
(binary)
#0001 to #0040
(binary)
---
Data Registers DR0 to DR15 ---
Index Registers ---
Indirect addressing
using Index Registers
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
Area S N R
R+N+1
R
R+1
R+2
R+3
S Cycle 1
S Cycle 2
S Cycle N
S: Source word
N: Number of cycles
Average
N values
Average Valid Flag
Pointer
Name Label Operation
Error Flag ER ON if the contents of N is 0.
OFF in all other cases.