Chapter 5 Instruction Words
5 - 12
inc statement Instruction to increment a variable
- Format
Format Description
inc <variable> This instruction increments <variable> by 1.
- Explanation
This instruction adds 1 to the value of <variable>.
- Sample program
(Code area [Code Window])
entry
LOOP inc U(00) : Assign "U (00) + 1" to U (00).
U(00) = U(00) and U(01) : Mask the 6 low-order bits of U (00).
Yw = U(00) : Output the content of U (00) to terminals Y (00) to Y (05).
wait 0.5 : Wait 0.5 second.
goto LOOP
end
(Data area [Data Window])
U(00) = 255
U(01) = 63
dec statement Instruction to decrement a variable
- Format
Format Description
dec <variable> This instruction decrements <variable> by 1.
- Explanation
This instruction subtracts 1 from the value of <variable>.
- Sample program
(Code area [Code Window])
entry
LOOP dec U(00) : Assign "U (00) - 1" to U (00).
U(00) = U(00) and U(01) : Mask the 6 low-order bits of U (00).
Yw = U(00) : Output the content of U (00) to terminals Y (00) to Y (05).
wait 0.5 : Wait 0.5 second.
goto LOOP
end
(Data area [Data Window])
U(00) = 255
U(01) = 63