Specifications

http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm
occurs. For that purpose, one infinite loop is made where the micro is retained while power is
connected. The necessary "end" at the end of each program informs the assembly translator that
no more instructions are in the program.
Control directives
4.1 #DEFINE Exchanges one part of text for another
Syntax:
#define<text> [<another text>]
Description:
Each time <text> appears in the program , it will be exchanged for <another text >.
Example:
#define turned_on 1
#define turned_off 0
Similar directives: #UNDEFINE, IFDEF,IFNDEF
4.2 INCLUDE Include an additional file in a program
Syntax:
#include <file_name>
#include "file_name"
Description:
An application of this directive has the effect as though the entire file was copied to a place where
the "include" directive was found. If the file name is in the square brackets, we are dealing with a
system file, and if it is inside quotation marks, we are dealing with a user file. The directive
"include" contributes to a better layout of the main program.
Example:
#include <regs.h>
#include "subprog.asm"
4.3 CONSTANT Gives a constant numeric value to the textual
designation
Syntax:
Constant <name>=<value>
Description:
Each time that <name> appears in program, it will be replaced with <value>.
Example:
Constant MAXIMUM=100
Constant Length=30
Similar directives: SET, VARIABLE
4.4 VARIABLE Gives a variable numeric value to textual
designation
Syntax:
Variable<name>=<value>
http://www.mikroelektronika.co.yu/english/product/books/PICbook/4_Poglavlje.htm (6 of 15) [4/2/2003 16:18:10]