Macro Assembler for P1, P2
jmg
Posts: 15,173
in Propeller 2
From another thread .. musings on Macro Assemblers, for P1 and P2 ...
I'm just now digging into fasmg , which continues to impress, the more I find out..
fasmg is the generic any-mcu macro version of fasm.
fasmg is part script engine, part assembler, and it is truly powerful.
It is coded in fasm, and comes in at a stunning 48k exe
Seems to have multi pass, and a means for automatic dead code removal.
HEX and LST are created via more scripts....
Download fasmg with examples, is a compact 236k
https://flatassembler.net/docs.php?article=fasmg_manual
https://flatassembler.net/fasmg.zip
Parallax P8X32A thread I started, to get some tips on how to best drive fasmg.
https://board.flatassembler.net/topic.php?p=190617#190617
Peter Jakacki wrote: »Re assembler - I would love to see a macro-assembler for the Prop!
I'm just now digging into fasmg , which continues to impress, the more I find out..
fasmg is the generic any-mcu macro version of fasm.
fasmg is part script engine, part assembler, and it is truly powerful.
It is coded in fasm, and comes in at a stunning 48k exe
Seems to have multi pass, and a means for automatic dead code removal.
HEX and LST are created via more scripts....
Download fasmg with examples, is a compact 236k
https://flatassembler.net/docs.php?article=fasmg_manual
https://flatassembler.net/fasmg.zip
Parallax P8X32A thread I started, to get some tips on how to best drive fasmg.
https://board.flatassembler.net/topic.php?p=190617#190617
Comments
Some web-help, and now Updated to include both IF_ Prefix and W Suffix handling.
So far it looks promising, the idea is to find a good Macro Assembler, so you can focus on other, more critical things instead...
I would like to see a short program using just a couple of P1 instructions, and the results of the compilation to get a better feel for it.
If the preliminaries look good, then there are probably enough of us to write macros for each instruction once we have a complete macro for one instruction (ie including labels, condcodes, etc).
The code above covers Immediate, and the condition code IF_ prefix, and ADD and SUB and will produce a binary file.
Not sure about any endian issues yet ?
I'm looking at suffix handling for WC,WZ,NR, and have a limited version of that working.
Need some tips from a fasmg expert to merge the prefix & suffix code ...
Speed checks :
; Listing ON -> 2 passes, 2.4 seconds, 16547 bytes, 266k LST
; Listing OFF -> 2 passes, 0.4 seconds, 16547 bytes, 80 byte LST
fasmg can export .hex via hex.inc macros, but that's slow, and seems to interact with other macros.
addit: New versions of Listing.inc and hex.inc followed this slow/interact report, and they are now (much) faster & interaction is fixed.
see: https://board.flatassembler.net/topic.php?p=191119#191119
Alternative HEX and DB outputs :
Some web searching finds srec_cat
Download https://sourceforge.net/projects/srecord/files/srecord-win32/
then run as and srec_cat can also do this, which is an ASM syntax DB list variant.
which can be INCLUDED into OnePin MCU ASM source, and it will auto-append the P2 code, to the small loader stub.
but I think we already have 'GAS does not match PASM' problems ?
This is more an opportunity to bring PASM more into line with other assemblers ?