Registers: Difference between revisions

No edit summary
 
Line 5:
 
When the program reaches a register instruction, it completes the math operation, overwrites the destination variable, and moves forward.
 
The leftmost variable in a register instruction is where the result is stored. Everything to the right of the equal sign is the equation to be performed.
 
{| class="wikitable"
Line 63 ⟶ 65:
|Mixed Logic
|}
A common use for Register instructions is a counter that increases the value of a register by one each time a program runs.
''Note that Position Registers must be initialized before any instructions that use them can run. For instructions on how to initialize a position register, see [[Data#Initialization of Position Registers|this section of the Data page.]]''
 
Example:
 
R[1] = R[1] + 1
 
This will take whatever is in R[1], add 1 to it, and store it to R[1]. Every time you run a program that contains this line, it will count up. This means a technician can walk up to a robot cell and glance at the register's contents to know exactly how many times the robot performed its task.
 
 
Below is a detailed explanation with examples of each of the register instructions from the table above.
 
==Equals Instruction==
Line 127 ⟶ 138:
 
=== When this instruction is reached ===