MACROS? with Propeller SPIN tool
DavidM
Posts: 630
HI,
Is there, or are there any plans to include some kind of "MACRO" functionality in the propeller tool?
i.e
I would like to have a small window appear when I compile that will list some variables ( and constants etc ) so I can change them for each compile.
I would like to have default values appear in the fields first, so that I can quickly compile with current values, but when I compile for production purposes I would like to change certain fields.
eg.
Serial numbers, base address, firmware/hardware versions, model number etc,
Sometimes I use the same spin software for several different versions of similar hardware and sometimes there are slight changes to say the i/o pins etc, It is difficult to maintain 2 version of the spin code.
I think a macro ( that is optional of course) could solve this problem.
My idea is that at the we could define a BLOCK called "MAC" for holding special code that runs at the start of compiling, this would hold the variable type and it name that appears in the window befor compiling, and would also include it default value.
eg ( very roughly thought of..)
Thanks
Dave M
Is there, or are there any plans to include some kind of "MACRO" functionality in the propeller tool?
i.e
I would like to have a small window appear when I compile that will list some variables ( and constants etc ) so I can change them for each compile.
I would like to have default values appear in the fields first, so that I can quickly compile with current values, but when I compile for production purposes I would like to change certain fields.
eg.
Serial numbers, base address, firmware/hardware versions, model number etc,
Sometimes I use the same spin software for several different versions of similar hardware and sometimes there are slight changes to say the i/o pins etc, It is difficult to maintain 2 version of the spin code.
I think a macro ( that is optional of course) could solve this problem.
My idea is that at the we could define a BLOCK called "MAC" for holding special code that runs at the start of compiling, this would hold the variable type and it name that appears in the window befor compiling, and would also include it default value.
eg ( very roughly thought of..)
MAC "Hardware Version ?" , LONG, HardVers = 1 " Serial Number ?", STRING, SerNum = "0000000"
Thanks
Dave M
Comments
-Phil
Do you think this is needed?
Dave M
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 2/8/2010 5:13:41 AM GMT
I dont use assembly (yet) , what about just for this simple purpose I described?
dave M
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away
Doesn't one of these have some form of macros???
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
You could put version numbers, serial numbers, etc. in a small text file, and then use the FILE command to include this in your code.· This way you could·edit the file in the propeller tool before each compile.· I think that's pretty close to what you're asking for.
As far as defining actual macros, it seems like a C preprocessor could be used to provide this capability.· The Watcom C compiler can be run with just the preprocessor by using the -P option.· I have a simple C preprocessor in my cspin utility.· However, that takes C source and converts it to Spin.
I'm developing another utility called spinasm that converts Spin to assembly.· I'll probably included the C preprocessor in it.· This could then be applied to the Spin code, even in sections that aren't converted to assembly.
Dave H