Chapter 6 Applied Instructions Symbol: S : Matrix source Word n : Length of the array Word D : Pointer Word Explanation: 1. When the instruction is executed, the state of SM613 is checked. If SM613 is ON, the value of the pointer D is cleared to 0. The value of the bit specified by the value of the pointer D is read into SM614. After the value of the bit is read, the state of SM612 is checked. If SM612 is ON, the value of the pointer D increases by one. 2. When the value of the last bit is read, SM608 is ON, and the bit number is recorded in the pointer D . 3. The operand n should be within the range between 1 and 256. 4. The value of the pointer is specified by users.
The values range from 0 to 16 n − 1, and correspond to the range from b0 to b16 n − 1. If the value of the pointer exceeds the range, SM611 is set to 1, and the instruction is not executed. Example: 1. Suppose SM613 is OFF and SM612 is ON when X0.0 is switched from OFF to ON. 2. Suppose the current value in D20 is 45. When X0.0 is switched from OFF to ON three times, users can get the following execution results. The value in D20 is 46, SM614 is OFF, and SM608 is OFF. The value in D20 is 47, SM614 is ON, and SM608 is OFF. The value in D20 is 47, SM614 is OFF, and SM608 is ON.
b0 b15 D0 D1 D2 D20 Ptr 6-285 API Instruction code Operand Function 1212 MBRD P S, n, D Reading the matrix bit Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S n D Pulse instruction 16-bit instruction (7 steps) 32-bit instruction AH500 AH500 - 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 45 45