Menu

command line

Help
2008-06-21
2013-05-30
  • Nobody/Anonymous

    Hi, I have tried to understand how to use the GCBasic command line. I cannot understand how to use the options %FILENAME%, %FN_NOEXT%, %CHIPMODEL% of A: and P: switches.
    Thank

     
    • Hugh Considine

      Hugh Considine - 2008-06-22

      %FILENAME% gets replaced with the name of the file that the assembler or programmer needs to use. If GCBASIC is writing to a file called compiled.asm, then %FILENAME% will replaced with compiled.asm for the assembler, and compiled.hex for the programmer.

      %FN_NOEXT" is similar, but doesn't give the extension. In the above example, %FN_NOEXT will be replaced with compiled.

      %CHIPMODEL% will be replaced with the model of the chip the program is for, using the same name as is used in the #chip directive. If you're compiling for a 16F88, then %CHIPMODEL% will be replaced with 16F88. This is mostly useful for programmers.

       
    • Nobody/Anonymous

      Thank you for the explanation, sorry if I bother you again but, I don't understand how to write the command line.
      The command line that comes with the installation of GCBASIC is:
      GCBASIC /O:compiled.asm A/:makeasm.bat /P:download.bat %1
      For istance I can use the shell dos command SET FILENAME=pwm.txt to set the value of FILENAME to pwm.txt.(pwm.txt is the name of the file, where I wrote my code in) . So I can rewrite the command line as the following:
      GCBASIC /O:compiled.asm A/:makeasm.bat /P:download.bat %FILENAME%. I am not sure that is correct, I saw that it runs.
      with reference to the options %FN_NOEXT% and %CHIPMODEL%, I understood what they do but I have no idea how to use them.

      thank you again
      paolo

       
    • Hugh Considine

      Hugh Considine - 2008-06-30

      What version of GCBASIC are you using?

      In many versions, you can write this:
      gcbasic filetocompile.txt /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

      In the newest versions, you can put lines like this into gcbasic.ini:
      '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 in 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 what GCBASIC will pass to WinPIC when you are using a 16F88.)

      Hopefully this makes it clearer, it is a bit confusing!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.