Chapter 3. Special registers

Table of Contents
Counter registers
Status registers

Counter registers

Registers C0..C99 work as auto-decremented counters. Each counter, containing the value greater than zero is decrement by one at the end of each WESCL loop, otherwise the value of a counter is unchanged.

Example 3-1. Using counters


     C8 : O8;
 not C8 : C8 = 2;
Generates a square wave on output O8 with a form factor 50%.

Attention, rewriting the above program in a following way:


 not C8 : C8 = 2;
     C8 : O8; /* counter C8 is always greater than zero at this moment! */

causes permanent setting the output O8 to logical 1.