File Logic Instructions
Chapter 16
169
Figure 16.6
WORDTOFILE LOGIC Operations
Operation
AND, OR, XOR
1
2
3
4
5
6
File B
1
2
3
4
5
6
File R
In this diagram, a logic operation is being performed on the word
and step three of File B and the result stored in step three of File R.
3
6
Position
File Length
Data Table Word
This instruction performs an AND operation on the contents of a specified
word in the data table and a word from File B. It places the result of the
operation into the corresponding word of File R (Figure 16.6).
The logic operation AND compares each bit in the word to the
corresponding bit in the File B word. If the compared bits are both 1, a 1 is
stored in the corresponding bit and word in File R. If the bits are both other
than 1, a 0 is stored in the corresponding bit in File R (Table 16.D).
Table 16.D
Truth Table for Logical WORDTOFILE AND
Corresponding Bit In
Bit In Word
File B
File R
1
1
0
0
1
0
1
0
1
0
0
0
Instruction Overview:
Key sequence: [FILE] 15
Output
instruction
Requires 5 words of user program
16.2.1
WordtoFile AND
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com