3. Command Line Options

3.1. Usage

The PICBASIC PRO™ Compiler can be invoked from the DOS command line using the following command format:

PBP Options Filename

Zero or more Options can be used to modify the manner in which PBP compiles the specified file. Options begin with either a minus ( - ) or a forward slash (/). The character following the minus or slash is a letter which selects the Option. Additional characters may follow if the Option requires more information. Each Option must be separated by a space and no spaces may occur within an Option.

Multiple Options may be used at the same time. For example the command line:

PBP -p16c71 -ampasm blink

will cause the file BLINK.BAS to be compiled using MPASM as the assembler and targeted for a PIC16C71 processor.

The first item not starting with a minus is assumed to be the Filename. If no extension is specified the default extension .BAS is used. If a path is specified, that directory is searched for the named file. Regardless of where the source file is found, files generated by PBP are placed in the current directory.

By default, PBP automatically launches the assembler (PM.EXE) if the compilation is performed without error. PBP expects to find PM.EXE in the same directory as PBP.EXE. If the compilation has errors or the -S option is used, the assembler is not launched.

If PBP is invoked with no parameters or filename, a brief help screen is displayed.

3.2. Options




Use a different Assembler


Insert source lines as Comments into assembler file


Output errors to a file


Display Help screen


Use a different Library file


Pass Option to assembler


Specify target Processor


Skip execution of assembler when done


Verbose mode


Add source level debugging information

3.2.1. Option -A

PBP has the capability to use either PM, which is included with PBP, or Microchip=s MPASM as its assembler. To specify MPASM (which must be acquired from Microchip), use -ampasm on the command line:

PBP -ampasm filename

If no assembler is specified on the command line, PM is used. See the section on assembly language programming for more information.

3.2.2. Option -C

The -C option causes PBP to insert the PICBASIC PRO™ source file lines as comments into the assembly language source file. This can be useful as a debugging tool or learning tool as it shows the PICBASIC PRO™ instruction followed by the assembly language instructions it generates.

PBP -c filename

3.2.3. Option -E

The -E option causes PBP to send all the errors to a file, fliename.er.

PBP -e filename

3.2.4. Option -H or -?

The -H or -?option causes PBP to display a brief help screen. This help screen is also displayed if no option and filename is specified on the command line.

3.2.5. Option -L

The -L option lets you select the library used by PICBASIC PRO™. This option is generally unnecessary as the default library file is set in a configuration file for each microcontroller. For more information on PICBASIC PRO™ libraries, see the advanced sections later in this manual.

PBP -lpbpps2 filename

This example tells PBP to compile filename using the PicStic2 library.

3.2.6. Option -O

The -O option causes the letters following it to be passed to the assembler on its command line as options. Some pertinent PM options are listed in the following table:

PBP -ol filename

This example tells PBP to generate a filename.lst file after a successful compilation.

More than one -O option may be passed to the assembler at a time.

The PICmicro Macro Assembler's manual on disk contains more information on the assembler and its options.

3.2.7. Option -P

If not told otherwise, PBP compiles programs for the PIC16F84. If the program requires a different processor as its target, its name must be specified on the command line use the -P option.

For example, if the desired target processor for the PBP program is a PIC16C74, the command line should look something like the following:

PBP -p16c74 filename

3.2.8. Option -S

Normally, when PBP successfully compiles a program, it automatically launches the assembler. This is done to convert the assembler output of PBP to an executable image. The -S option prevents this, leaving PBP's output in the generated .ASM file.

Since -S prevents the assembler from being invoked, options that are simply passed to the assembler using the -O option are effectively overridden.

PBP -s filename

3.2.9. Option -V

The -V option turns on PBP=s verbose mode which presents more information during program compilation.

PBP -v filename

3.2.10. Option -Z

The -Z option tells PBPW to add source level simulation and debugging information to the files that are generated during compilation. For an example of how to use this within MPLAB, see the README.TXT file.

PBP -z filename