Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix A: Programming a Microcontroller
Instructions are defined for each microcontroller family by the manufacturer. Therefore, it is up to the user to follow the
rules of their usage. The way of writing instructions is also called instruction syntax. The instructions "movlp" and
"gotto", in the following example, are recognized by the PIC16F887 microcontroller as an error since they are not
correctly written.
OPERANDS
An operand is a value (an argument) upon which the instruction, named by mnemonic, operates. The operands may be a
register, a variable, a literal constant, a label or a memory address.
DIRECTIVES
Unlike instructions being written to on-chip program memory after compilation, directives are commands of assembly
language itself and do not directly affect the operation of the microcontroller. Some of them must be used in every
program while others are only used to facilitate or enhance the operation. Directives are written to the column reserved
for instructions. The rule which must be observed allows only one directive per program line.
This section covers only a few of the most commonly used directives. It would certainly take up too much space and time
to describe all the directives recognized by the MPLAB program. Anyway, a complete list containing all directives which
the MPLAB assembler can understand is provided in Help.
PROCESSOR Directive
This directive must be written at the beginning of each program. It defines the type of the microcontroller which the
program is written for. For example:
Processor 16f887
http://www.mikroe.com/en/books/picmcubook/appa/ (3 of 21)5/3/2009 11:35:35 AM