PDA

View Full Version : Command Line Compile



Normnet
- 20th July 2009, 04:23
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

mackrackit
- 20th July 2009, 09:53
Here is the guts of a *.bat file I use.


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.

Darrel Taylor
- 20th July 2009, 10:28
When there are spaces in the filename, you need to put quotes around it.

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

Normnet
- 20th July 2009, 13:00
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

mackrackit
- 20th July 2009, 13:11
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.

Darrel Taylor
- 20th July 2009, 13:16
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>

mackrackit
- 20th July 2009, 19:51
This is what I use when on a Linux box and do not have the "paths" set.


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 "/ \ / \ / \" :)

Normnet
- 21st July 2009, 03:48
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

mackrackit
- 21st July 2009, 04:53
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.

Normnet
- 21st July 2009, 06:53
Success!
Thanks all.

Norm

Normnet
- 25th July 2009, 18:24
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

mackrackit
- 25th July 2009, 18:36
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.

Normnet
- 25th July 2009, 19:00
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

mackrackit
- 25th July 2009, 19:09
Is this what you are needing?
http://www.computerhope.com/issues/ch000320.htm

mackrackit
- 25th July 2009, 19:11
Google this and a whole bunch of option come up.
"close a DOS window"

Normnet
- 29th August 2009, 22:05
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.



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

mackrackit
- 30th August 2009, 01:27
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?

Normnet
- 30th August 2009, 03:00
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

mackrackit
- 30th August 2009, 03:40
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.