Is there an equivalent p2asm for the P1?
Peter Jakacki            
            
                Posts: 10,193            
            
            
                            
                                  in Propeller 1             
        
                    I like using @"Dave Hein"'s excellent p2asm for assembling P2 files since I use the m4 preprocessor to manage my include files and then loadp2 to load it onto the P2. p2asm also generates a proper listing.
Now I am looking at standardizing how I compile Tachyon for P1 and TAQOZ for P2 while making Forth source files as compatible as possible since I am redoing EASYFILE and EASYNET and I want to use the same source with conditional compile for P1 and P2.
Is there something like p2asm and even loadp2 for the P1?
                            Now I am looking at standardizing how I compile Tachyon for P1 and TAQOZ for P2 while making Forth source files as compatible as possible since I am redoing EASYFILE and EASYNET and I want to use the same source with conditional compile for P1 and P2.
Is there something like p2asm and even loadp2 for the P1?

                            
Comments
EDIT: And also spinpp, which is a C-like preprocessor for Spin/PASM programs.
All support conditional assembly. bst and homespun have optional listings, not sure about OpenSpin.
Spinnaker does as well. Here are the changes Spinnaker makes to Openspin:
1. Added '-a' command line option to specify that alternate "homespun"-like preprocessor behavior be used: - Encountering a #error statement terminates the compilation. - Files included with #include will be found if they exist anywhere in the include directories specified on the command line. - Symbols defined with no value (or on the command line) will not be used for macro substitution - they can only be used in #ifdef and #ifndef statements. For example: #define FOO #ifndef FOO #error FOO is not defined! <-- FOO is defined under either set of rules #endif PUB START | FOO,BAR <-- generates an error if -h is not used 2. Added '-M' to specify memory size. The default is 32768, but any size up to 16777216 can be specified. This is commonly used to specify an EEPROM size. DAT, binary and eeprom files can be generated of any size up to the specified memory size, but if memory sizes larger than 32768 are generated then some programs may be able to use the resulting dat files, but only Catalina will be able to use the binary and eeprom files, since it does not depend on the internal file offsets which are limited in these file formats to 16 bits. 3. Added -b and -e to specify whether a binary or eeprom format output file should be created. The default is binary. The size of the output file when -e is specified (or the maximum size when -b is specified) defaults to 32k, but this can be overriden by using the '-M' command line switch. 4. Fixed a bug where the preprocessor would lose track of the state of complex #if[n]def statements (e.g. if they contain #include statements). 5. Fixed a bug where the name of the file containing the start of a #if[n]def statement was incorrectly reported if the statement was not terminated correctly. 6. Fixed a bug that resulted in some source lines being incorrectly detected as comment lines. 7. Fixed a bug that resulted in macro substitution within string constants. 8. Added a listing capability, enabled by specifying '-l'. The listing only contains DAT sections at present - it may be expanded later to include other sections.@RossH - You mentioned the preprocessor behavior. Does Spinnaker allow include files and conditional assembly specified in the source file vs command line? Certainly with the ifdef type statements it looks like it can handle conditional assembly.
This is the main reason I use m4 although it is a lot more powerful than that. However I want to make sure it is just as easy for someone else to compile too although of course there would always be the output file from the preprocessor that could be used.
fastspin can handle both P1 and P2 assembly and has conditional compilation, so you can use the same source with it to produce both P1 and P2 binaries.
In place of loadp2 I use the command line propeller-load tool for P1. FlexGUI comes with fastspin, loadp2, and propeller-load all packaged together.
Yes, spinpp is equivalent to cpp, but for Spin programs.
The bake and m4 file generate a standard .spin and binary output as well as downloading it to the P1.
'' TACHYON M4 PREPROCESSOR BUILD include(`version.spin') include(`config.spin') include(`mem.spin') include(`compcons.spin') include(`globals.spin') include(`taskregs.spin') include(`lmm.spin') include(`print.spin') include(`search.spin') include(`comments.spin') include(`compile.spin') include(`threaded.spin') include(`create.spin') include(`debug.spin') include(`runmods.spin') include(`branch.spin') include(`startup.spin') include(`console.spin') include(`loader.spin') include(`dictionary.spin') include(`roms.spin') DAT { force console and Tachyon kernel image to top of hub memory } byte 0[varram-(@romend+s)] include(`serial.spin') include(`pingpong.spin') include(`kernel.spin') include(`boot.spin') ''( info ) ''( changelog )This thread is simply about a different way to maintain and build the kernel rather than as one big ugly file using the Prop tool or equivalent.