About the Command Line Parameters
GCBASIC [/O:output.asm] [/A:assembler] [/P:programmer] [/K:{C|A}] [/H:[Y/1 | N/0]] [/V] [/L] [/NP] [/M:[Y/1 | N/0]] filename
GCBASIC [/O:output.asm] [/A:assembler] [/P:programmer] [/K:{C|A}] [/H:[Y/1 | N/0]] [/V] [/L] [/WX] [/M:[Y/1 | N/0]] [/NP] filename
GCBASIC [/O:output.asm] [/A:assembler] [/P:programmer] [/K:{C|A}] [/H:[Y/1 | N/0]] [/V] [/L] [/WX] [/M:[Y/1 | N/0]] [/S:Use.ini] [/NP] filename
GCBASIC [/O:output.asm] [/A:assembler] [/P:programmer] [/K:{C|A}] [/H:[Y/1 | N/0]] [/V] [/L] [/WX] [/M:[Y/1 | N/0]] [/S:Use.ini] [/F[O]] [/NP] filename
GCBASIC [/O:output.asm] [/A:assembler] [/P:programmer] [/K:{C|A}] [/H:[Y/1 | N/0]] [/V] [/L] [/WX] [/M:[Y/1 | N/0]] [/S:Use.ini] [/F[O]] [/NP] filename /DO
GCBASIC [/O:output.asm] [/A:assembler] [/P:programmer] [/K:{C|A}] [/H:[Y/1 | N/0]] [/V] [/L] [/WX] [/M:[Y/1 | N/0]] [/S:Use.ini] [/F[O]] [/NP] filename /AO
GCBASIC /version| Switch | Description | Default |
|---|---|---|
|
|
Batch file used to call assembler(1). If |
The program will not be assembled |
|
|
Use .build folder for assembly operations. |
This is the Assembly Only switch. |
|
|
Exports the config bits automatically selected by the compiler to an output file called |
None |
|
|
Use .build folder for debugger operations. |
This is the DirectoryOutput switch. |
|
|
Used to bypass compilation when not needed - the compiler will verify that the config settings in the already-compiled file match those required for the programmer. If not, a recompilation will be forced. Skip compilation if the hex file is up to date and has the correct config. /F:x (F or 0) to force a fresh compile regardless of what the ini file specifies. |
|
|
|
Used to bypass compilation and program only. The compiler will verify that the config settings in the already-compiled file match those required for the programmer. If not, a recompilation will be forced. |
|
|
|
Set the production, or not, of the hex output file. /H:1 is the default. To prevent production of the hex output file, use /H:0. |
The default is to produce the hex output file |
|
|
Keep original code in assembly output. |
No original code left in output. |
|
|
Show license and exit. |
- |
|
|
Mute the banner messages, or not. |
The default is to output banner messages |
|
|
Do not pause on errors. Use with IDEs. |
Pause when an error occurs, and wait for the user to press a key. |
|
|
Sets the name of the generated assembly file to |
Same name as the input file, but with a |
|
|
Batch file used to call programmer(1). This parameter is ignored if the program is not assembled. |
The program will not be downloaded. |
|
|
Load the settings from a specified file, rather than use the defaults. |
/S:use.ini |
|
|
Verbose mode — the compiler gives more detailed information about its activities. |
- |
|
|
Force compiler to ensure all include files are valid. |
|
|
|
Show build date and version of the compiler. |
|
|
|
The file to compile. |
- |
(1) For the /A: and /P: switches, there are special options available. If
%FILENAME% is present, it will be replaced by the name of the .asm file.
%FN_NOEXT% will be replaced by the name of the .asm file but without an
extension, and %CHIPMODEL% will be replaced with the name of the chip.
The name of the chip will be the same as that on the chip data file.
A batch file to load the ASM from GCBASIC into MPASM. The command line should look like this:
C:\progra~1\microc~1\mpasms~1\MPASMWIN /c- /o- /q+ /l- /x- /w1 %code%.asm
A batch file to compile in GCBASIC and then load the ASM from GCBASIC into GPASM. The command line should look like this:
gcbasic.exe %1 /NP /K:A /A:"..\gputils\bin\gpasm.exe %~d1%~p1%~n1.asm"
To instruct MAKEHEX.BAT to use GPASM (you have GPUTILS installed), edit the batch file as follows:
REM Create the ASM
gcbasic.exe /NP /K:A %1
REM Use GPASM piping to the GCB error log
gpasm.exe "%~d1%~p1%~n1.asm" -k -i -w1 >> errors.txtTo summarise, you can use any of the following:
gcbasic.exe filetocompile.gcb /A:GCASM /P:"icprog -L%FILENAME%" /V /O:compiled.asm
GCBASIC will compile the file, then assemble the program, and run this command:
`icprog -Lcompiled.hex`
You can also create/edit the gcbasic.ini file:
Assembler settings
Assembler = C:\Program Files\Microchip\MPASM Suite\mpasmwin
AssemblerParams = /c- /o- /q+ /l+ /x- /w1 "%FileName%"
Programmer settings
Programmer = C:\Program Files\WinPic\Winpic.exe
ProgrammerParams = /device=PIC%ChipModel% /p "%FileName%"This example will use MPASM to assemble the program. It will run the program specified on the assembler = line, and give it these parameters:
`/c- /o- /q+ /l+ /x- /w1 "compiled.asm"`
Then it will run the programmer, and give it these parameters when it calls it:
`/device=PIC16F88 /p "compiled.hex"`
%ChipModel% will get replaced with the chip you are using, so this is the chip GCBASIC will pass to WinPIC.
Errors.txt
The compiler only produces the file errors.txt if there is an error. The creation of the errors.txt file makes it easier for IDEs to detect whether the program compiled successfully - if the file was not produced, the IDE would be unable to present the error message to the user.
The file errors.txt is always produced in the same folder as the compiler. Typically: C:\GCStudio\GCBASIC\Errors.txt
USE.INI
USE.INI is the provided setup file for the compiler. The name use.ini is historic and of no relevance.
USE.INI is generally updated by using the PREFERENCES EDITOR.
USE.INI is self-documenting - opening use.ini in an editor will show the full capabilities of the settings file.
The details below show the self-documentation in a typical use.ini
Preferences file for GC BASIC
Location: GCB install (or custom) dir
Documentation for the [gcbasic] section of the use.ini file
programmer = arduinouno - the currently selected available programmers
showprogresscounters = n - show percent values as compiler runs. requires Verbose = y
verbose = y - show verbose compiler information
preserve = n - preserve source program in ASM
warningsaserrors = n - treat Warnings from scripts as errors.
pauseaftercompile = n - pause after compiler. Do not do this with IDEs
flashonly = n - Flash the chip is source older that hex file
assembler = GCASM - currently selected Assembler
hexappendgcbmessage = n - appends a message in the HEX file
laxsyntax = n - use lax syntax when Y, the compiler will not check that reserved words are used with their correct case and spelling
mutebanners = n - mutes the post compilation messages
evbs = n - show extra verbose compiler information, requires Verbose = y
nosummary = n - mutes almost all messages post compilation
extendedverbosemessages = n - show even more verbose compiler information, requires Verbose = y
conditionaldebugfile = - creates CDF file
columnwidth = 180 - ASM width before wrapping
picasdebug = n - adds PIC-AS preprocessor message to .S file
datfileinspection = y - inspects DAT for memory validation
methodstructuredebug = n - show method structure start & end for validation
floatcapability = 1 - 1 = singles
- 2 = doubles
- 4 = longint
- 8 = uLongINT
compilerdebug = 0 - 1 = COMPILECALCADD
- 2 = VAR SET
- 4 = CALCOPS
- 8 = COMPILECALCMULT
- 16 = AUTOPINDIR
- 32 = ADRDX
- 64 = GCASMSee Also:
- Using GCBASIC — compiling and flashing from the IDE instead of the command line
- About the Preferences Editor — the GUI tool for editing use.ini

