ROL - The Roll Left Command
The ROL command is a bitwise operation that takes the value in the accumulator and moves all of the bits to towards the MSB (to the left). The bit in the MSB is placed into the Carry Flag and the state of the Carry Flag becomes the LSB.
After 9 ROL commands the bits are restored to their original positions.
You can use this in conjunction with the BCC and BRC commands to interrogate individual bits without destroying their contents.
This command is the opposite of the ROR command.
Syntax
ROL
Notice that there are no values attached to the command. It simply moves everything one spot left putting the MSB in the Carry Flag and moving the Carry Flag into the LSB.
The ROL command has the byproduct of multiplying the value by 2. |
Examples
Task1()
{
Name="Dipswitch checker" //Branches on the highest dipswitch set
LDA ^59,0 //Get the dipswitch port
ROL //Move Dipswitch 8 into the carry flag
BRC DipSwitch8Set //If carry flag is set branch.
ROL //Move next Dipswitch into the carry flag
BRC DipSwitch7Set //If carry flag is set branch.
...
}