Download Documentation for Pic Micro Pascal

Transcript
PIC MICRO PASCAL V1.6 - USER MANUAL
Summary
1 Overview..................................................................................................................................... 6
1.1 Legal stuff......................................................................................................................................... 7
1.2 BSD License..................................................................................................................................... 7
2 Operation.................................................................................................................................... 8
2.1 Operating system............................................................................................................................. 8
2.2 MPLAB® suite.................................................................................................................................. 8
2.3 Console version................................................................................................................................ 8
2.3.1 Command line usage.......................................................................................................... 8
2.3.2 Message output from PMP compiler...................................................................................9
2.3.3 Exit code............................................................................................................................. 9
2.4 Windows version............................................................................................................................ 10
2.4.1 PMP Project ..................................................................................................................... 12
2.4.1.1 Project general options......................................................................................12
2.4.1.2 Compiler options............................................................................................... 13
2.4.1.3 Assembler options............................................................................................. 14
2.4.1.4 Linker options.................................................................................................... 14
2.4.1.5 Processor options............................................................................................. 14
2.4.1.6 Version and comments......................................................................................15
2.4.2 Code Explorer................................................................................................................... 16
2.4.3 The tools menu.................................................................................................................. 17
2.4.4 Syntax highlighting and other editor options......................................................................19
2.5 Generated files............................................................................................................................... 21
2.6 Configuration file............................................................................................................................. 22
3 Language features....................................................................................................................23
3.1
3.2
3.3
3.4
3.5
3.6
3.7
BNF representation in this document............................................................................................. 23
Keywords........................................................................................................................................ 23
Constant formats............................................................................................................................ 24
Program structure........................................................................................................................... 25
Unit structure.................................................................................................................................. 26
Comments...................................................................................................................................... 27
Directives........................................................................................................................................ 27
3.7.1 $C | $CODEGEN - PLC mode code..................................................................................27
3.7.2 $CONFIG - Configuration bits........................................................................................... 27
3.7.3 $DEPRECATED – Define a unit, procedure or function as obsolete.................................28
3.7.4 $EEPROM - Define useable EEPROM area....................................................................28
3.7.5 $EOL – Define end of line behavior...................................................................................28
3.7.6 $EXTENDED – Enable / disable extended Pascal syntax - NEW! (V1.6.0).......................28
3.7.7 $FREQUENCY - Processor frequency..............................................................................28
3.7.8 $IDLOC Define user ID bytes............................................................................................ 29
3.7.9 $I | $INCLUDE - Include source file...................................................................................29
3.7.10 $INIT | $INITIALIZE - Define start-up initializations.........................................................30
3.7.11 $INTERRUPTS – Enable / disable / define interrupts......................................................30
3.7.12 $JUMPS – Define jumps range.......................................................................................31
3.7.13 $O | $OPTIM | $OPTIMIZE - Define optimization mode..................................................31
3.7.14 $OPTIMIZE_PARAMS - Define parameter passing optimization mode...........................31
3.7.15 $OSCCAL – Activates or deactivates OSCCAL processor feature..................................31
3.7.16 $P | $POINTERS - Define pointers size..........................................................................32
3.7.17 $POP – Restore compiler options ..................................................................................32
3.7.18 $PROCESSOR - Define processor.................................................................................32
3.7.19 $PUSH – Save compiler options.....................................................................................33
3.7.20 $RESERVED RAM | EEPROM - Specify a memory region as unusable........................33
3.7.21 $SCRIPT – Define the linker script to use.......................................................................33
3.7.22 $S | $SPACE - Switch memory allocation to RAM or EEPROM......................................33
3.7.23 $STRINGS - Set default string size.................................................................................34
Document revision: A
-
Page 2/101