Command Line Compile


+ Reply to Thread
Results 1 to 19 of 19
  1. #1
    Join Date
    Oct 2004
    Posts
    440

    Default Command Line Compile

    I am near beta stage with a new standalone FineLine IDE for both Proton and MEL PicBasic!
    I would like to utilize the command line compile but am stuck.

    The following is what I am trying (as per manual) in Windows run but doesn't work:

    E:\1PicBasicPro\PBP\PBPL.exe -ampasmwin -p18f4520 E:\1PBP\Headings\09-06-26-05 18F4520 4MHz Heading,Int OK.bas

    I am looking for a hex file in the above E directory with a new time modified.

    Norm

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Here is the guts of a *.bat file I use.
    Code:
    cd
    cd C:\MAC_PROGS\PPPBP\
    PBPL -e -ampasmwin -p18F4550 test.bas
    cd\
    The above works if the "paths" are set in windows environment.
    Maybe it will give you a clue. Your part about "time modified" has me a bit confused.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    When there are spaces in the filename, you need to put quotes around it.
    Quote Originally Posted by Normnet View Post
    E:\1PicBasicPro\PBP\PBPL.exe -ampasmwin -p18f4520 "E:\1PBP\Headings\09-06-26-05 18F4520 4MHz Heading,Int OK.bas"
    DT

  4. #4
    Join Date
    Oct 2004
    Posts
    440

    Default

    Your part about "time modified" has me a bit confused
    I meant date modified.

    Does the newer PBPL save a .pbp in place of a .bas file for compile?

    In windows run
    E:\1PicBasicPro\PBP\PBPL.exe -ampasmwin -p18f4520 "E:\1PBP\Headings\09-06-26-05 18F4520 4MHz Heading,Int OK.pbp"
    gets a brief flash of a DOS screen but no updated .hex file.

    Norm

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    pbp or bas. both are valid.

    Check the error file to maybe see what is wrong. Could be an error in the code. If so then a hex will not be created or updated.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Quote Originally Posted by Normnet View Post
    gets a brief flash of a DOS screen but no updated .hex file.
    Do you have C:\Program Files\Microchip\MPASM Suite; in your PATH?
    <br>
    DT

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    This is what I use when on a Linux box and do not have the "paths" set.
    Code:
    cd /home/shop/MAC/PIC\ LINUX/SweepBot
    wine c:/pbp/pbpw -e -s -ac:/Program\ Files/Microchip/MPASM\ Suite/MPASMWIN -p16f676 z:/home/shop/MAC/PIC\ LINUX/SweepBot/SB1.bas
    wine c:/Program\ Files/Microchip/MPASM\ Suite/mpasmwin /e /l SB1.asm
    Basically what happen is PIC BASIC does it's thing by making an ASM file per MPASM's standards, and then MPASM runs to convert the ASM to HEX.

    Should work on windows too...Once you get rid of the "wine" and fix up the "/ \ / \ / \"
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Oct 2004
    Posts
    440

    Default

    Do you have C:\Program Files\Microchip\MPASM Suite; in your PATH?
    Path set as:
    I:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;I:\P rogram Files\Borland\BDS\4.0\Bin;%SystemRoot%\system32;%S ystemRoot%;%SystemRoot%\System32\Wbem;I:\Program Files\Microchip\MPASM Suite

    cd /home/shop/MAC/PIC\ LINUX/SweepBot
    Windows run doesn't take a "cd" no quotes.

    Also trying in a Delphi program ShellExecute(Handle, 'open', PChar(Edit1.TEXT), nil, nil, SW_SHOWNORMAL);

    My conversion, not working from windows run(brief DOS flash) or Delphi shell(nothing):
    wine c:/pbp/pbpw -e -s -ac:/Program\ Files/Microchip/MPASM\ Suite/MPASMWIN -p16f676 z:/home/shop/MAC/PIC\ LINUX/SweepBot/SB1.bas
    e:\1PicBasicPro\PBP\PBPL -e -s -ai:\Program Files\Microchip\MPASM Suite\MPASMWIN -p18f4520 e:\1PBP\Headings\test.pbp
    e:\1PicBasicPro\PBP\PBPL -e -s -ampasmwin -p18f4520 e:\1PBP\Headings\test.pbp

    Norm
    Last edited by Normnet; - 21st July 2009 at 04:53.

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    You are writing an editor correct?
    That was my point of showing you the guts of a windows *.bat file.
    Have your editor create the BAT then have the editor run it. Or you can put the shebang
    line in a window DOS prompt window. And yes you will have to CD into it.
    Windows RUN is not quite the same as a DOS prompt.
    Dave
    Always wear safety glasses while programming.

  10. #10
    Join Date
    Oct 2004
    Posts
    440

    Default

    Success!
    Thanks all.

    Norm

  11. #11
    Join Date
    Oct 2004
    Posts
    440

    Default

    How to make bat file terminate on last command instead of waiting
    until the program (programmer) it opened is closed.

    Sorry, started computers in 1995 (AD after DOS).

    Norm

  12. #12
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Not sure I follow.
    The examples I gave will start MPASMWIN. When that GUI is finished and OK is clicked the DOS window should terminate.
    Dave
    Always wear safety glasses while programming.

  13. #13
    Join Date
    Oct 2004
    Posts
    440

    Default

    MPASMWIN is OK.

    My programmer (Easy PIC 3) doesn't close after completed and keeps the DOS file open.
    Is their a DOS way to terminate itself once the programmer is launched?
    The next line in DOS doesn't run until programmer is closed.

    Norm

  14. #14
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Is this what you are needing?
    http://www.computerhope.com/issues/ch000320.htm
    Dave
    Always wear safety glasses while programming.

  15. #15
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Google this and a whole bunch of option come up.
    "close a DOS window"
    Dave
    Always wear safety glasses while programming.

  16. #16
    Join Date
    Oct 2004
    Posts
    440

    Default

    Command line compiles to asm and asm to hex with MPASM!

    Now to trouble shoot compile with PBPW to asm and to hex with PM for 16's.

    The following instructions in a bat file produces files but with different file names format than MicroCode Studio IDE.

    Code:
     
    PATH = E:\1PicBasicPro\PBP;E:\2TEST
    E:
    cd E:\2TEST
    E:\1PicBasicPro\PBP\PBPW.exe -e -p16F877 "E:\2TEST\PBP16F877TEST2.pbp"
    
    E:
    cd E:\2TEST
    E:\1PicBasicPro\PBP\PM.exe "E:\2TEST\PBP16F877TEST2.asm"
    
    E:\EasyPIC3 7-8-06\PICFLASH2.exe -ppic16F877 -f"E:\2TEST\PBP16F877TEST2.hex" -w
    My bat file produces the following file names format:
    PBP16F877TEST2.pbp
    PBP16F877TEST2.ASM
    PBP16F877TEST2.ER
    PBP16F877TEST2.MAC
    PBP16F~1.HEX

    MicroCode Studio produces the following file names format:
    PBP16F877TEST2.pbp
    PBP16F877TEST2.asm
    PBP16F877TEST2.mac
    PBP16F877TEST2.hex


    Both hex files are valid but how to produce the full length hex filename?
    I am reading the PM.txt file in PBP directory but have not seen a solution.

    Norm
    Last edited by Normnet; - 29th August 2009 at 23:21.

  17. #17
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Look at your PBP install CD, I think there is infor there about the PM assembler.

    But I will ask, why even bother with PM?
    Dave
    Always wear safety glasses while programming.

  18. #18
    Join Date
    Oct 2004
    Posts
    440

    Default

    The help section of MicroCode Studio says PM assembler is faster and also is
    required for non pro version. However PM doesn't do 18's.
    Their may be some who have written their programs with the PM style of
    configuration fuses.

    Didn't see any info on the install CD unless I are blind.

    I noticed there isn't any dos bat file appearing on PM with MicroCode Studio.

    Norm
    Last edited by Normnet; - 30th August 2009 at 04:09.

  19. #19
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    I must be blind too. I was going by the printed manual. I can not find it either.
    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.
    If all else fails you could have your program rename the hex file when PM is finished.
    Be another pain in the _ _ _ though.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Unable to pass a variable to LCDOUT without getting compile errors
    By Ferroto Baggins in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2010, 17:43
  2. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 15:51
  3. USB PBPL Compile errors
    By Rob in forum USB
    Replies: 11
    Last Post: - 7th April 2008, 09:18
  4. Cannot compile for 40MHz 4 x pll
    By passion1 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 21st October 2007, 18:50
  5. Replies: 2
    Last Post: - 9th February 2006, 23:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts