Compiling from command line
Posted: Mon Oct 21, 2013 11:49 pm
BASICtools handles the steps necessary to compile a BASIC program into a hex file and then download that hex file to a target ARM processor
those steps are
- determine what CPU is being used and generate a #define LPC1756 or equivalent
- run the pre-processor
- prepend the vectors for the CPU being used.
- add "QUITDUMP" to the above output
- compile all that with ARMbasic.exe
- send the resulting hex file to the CPU
For the BLINKY.bas example
Blinky.bas uses the pre-processor.
bpp is not setup to use pipe input (source is at http://www.coridiumcorp.com/forum/viewt ... =bpp#p1178)
so you would have to create a 1 line (let us call it defLPC1756.bas) and it contains 1 line -
#define LPC1756 ' BASICtools now inserts this or the equivalent into all programs now
then do-
copy defLPC175x.bas+blinky.bas temp.bas
then
bpp temp.bas > temp.bpp
next another 1 line file (quitdump.bas) that is the 1 line
QUITDUMP
You also need a set of vectors from the SuperPRO or LPC4078 (they WILL be different and WILL change with different firmware versions). You can get those by typing a ? into the enter line of BASICtools and cutting and pasting the output into a file vectors.bas (when you use BASICtools this is in %temp%\coridium\__temp.bas)
Here is a command line program that gets the vectors (file attached here )
getBASICvectors > vectors.bas
copy vectors.bas+temp.bpp+quitdump.bas temp.ab
Compile that file and pipe the output to a downloader program (file attached here below)
ARMbasic.exe < temp.ab | loadBASIC com8
The compile and download is complete.
I'll post the source for these utilities next
those steps are
- determine what CPU is being used and generate a #define LPC1756 or equivalent
- run the pre-processor
- prepend the vectors for the CPU being used.
- add "QUITDUMP" to the above output
- compile all that with ARMbasic.exe
- send the resulting hex file to the CPU
For the BLINKY.bas example
Blinky.bas uses the pre-processor.
bpp is not setup to use pipe input (source is at http://www.coridiumcorp.com/forum/viewt ... =bpp#p1178)
so you would have to create a 1 line (let us call it defLPC1756.bas) and it contains 1 line -
#define LPC1756 ' BASICtools now inserts this or the equivalent into all programs now
then do-
copy defLPC175x.bas+blinky.bas temp.bas
then
bpp temp.bas > temp.bpp
next another 1 line file (quitdump.bas) that is the 1 line
QUITDUMP
You also need a set of vectors from the SuperPRO or LPC4078 (they WILL be different and WILL change with different firmware versions). You can get those by typing a ? into the enter line of BASICtools and cutting and pasting the output into a file vectors.bas (when you use BASICtools this is in %temp%\coridium\__temp.bas)
Here is a command line program that gets the vectors (file attached here )
getBASICvectors > vectors.bas
copy vectors.bas+temp.bpp+quitdump.bas temp.ab
Compile that file and pipe the output to a downloader program (file attached here below)
ARMbasic.exe < temp.ab | loadBASIC com8
The compile and download is complete.
I'll post the source for these utilities next