| (1) The definition part of the hardware |
|
Specifie the kind of PIC to use. It is changed based on this specification when changing the source code into the machine code.
LIST of the assembler direction is used.
The directions are not the instructions to use in actual PIC. They are the direction which is used to specify the processing of an assembler. |
|
|
(2) The definition part of the register files |
| In case of PIC16F84A, the file register of 68 bytes can be used. When attaching a label to each register, the understanding of processing becomes easy. When changing a register in the arrangement, it is OK if changing the definition of the label. It makes a label and an actual address correspond. EQU of the assembler direction is used. |
|
|
(3) The initialization processing part |
|
From this part, the processing to do actually in PIC is written. The initialization processing is the processing to do first when PIC works. It sets the environment of the processing which is done after that such as the setting of an input/output port, the initialization of the STATUS register, the initialization of the register file contents so on.
When specifying the address which stores a program in the memory, ORG is used as the direction. |
|
|
(4) The main processing part |
|
Write the processing to have operation for the purpose.
It is sometimes divided into the main part and the subroutine part in the construction of the program.
In the case as it uses the same processing repeatedly, it makes common processing as the subroutine. Generally, it writes a subroutine group behind the main part but even if it is opposite, there is no problem. |
|
|
(6) The source ending |
|
The ending of the source code is written.
END of the assembler direction is used. |