Conditional statements are all very well, but you also need a way that you can make your program repeatedly perform something for you. This means that you need to create a loop of some kind. If you think about it, loops are especially important in the case of the PICmicro microcontroller. The PICmicro microcontroller has no way of "stopping". Unlike a normal computer program, the code which controls a PICmicro microcontroller has no way of going back to the user and saying "What do you want me to do next?". PICmicro microcontroller programs must never finish.
Unlike the Virtual CPIC, if you reach the end of a program inside a PICmicro microcontroller it will simply try to obey the instructions which follow the end of your program, with possibly hilarious (for everyone else) results. This means that your PICmicro program will need to run in an endless loop of some kind, repeatedly looking at something and responding appropriately.
We see this in our first example, in which the PICmicro microcontroller is constantly monitoring a switch and turning a light on when it sees that the switch is closed.
On the right you can see the kind of loop which most PICmicro microcontroller programs will run through. First we read the inputs, then we perform some processing, then we output data, then we do it all again...