Back to earth ... anyone have a PASM assembler?
jazzed
Posts: 11,803
I want to compile an image that is directly executable from external RAM or flash.
Has anyone written a PASM assembler that might be leveraged to do this like an LMM assembler?
I prefer an open source project, but a "binary" that could have some features added is good too.
Obviously all jump like instructions and hub instructions would require COG primitives to operate.
Being able to compile PASM into a code block for loading COGs would be useful in the end.
Thanks
Has anyone written a PASM assembler that might be leveraged to do this like an LMM assembler?
I prefer an open source project, but a "binary" that could have some features added is good too.
Obviously all jump like instructions and hub instructions would require COG primitives to operate.
Being able to compile PASM into a code block for loading COGs would be useful in the end.
Thanks
Comments
I pretty much got all the parsing done and was on the way to having an assembler.
I gave up. Because I'm crazy I wrote the thing in ADA. Because I'm really crazy I used ADA's object oriented features. A first for me. The thing got to huge and complicated and then out comes HomeSpun and BST.
You could pick that up to finish but I'm sure there are better options out there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Isn't that pretty much how Catalina works with homespun?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
I'm not clear on exactly what you're after. If you are willing to replace the jump instructions (etc) with various cog primitives, then I'm not clear on what is the difference is between what you are asking for and an LMM kernel executing ordinary PASM code? If you use the Catalina kernel, you can use it to execute any PASM compiled with Homespun - you just have to avoid a couple of specific instructions (details are given in the Catalina documentation). The PASM code doesn't have to include any LMM primitives if you don't need to use them - although you would probably want to at least use the LMM jump instructions (hub instructions are fine). If you want you could then remove the unused LMM kernel functions and use the extra space in the kernel cog for local variables. The Catalina kernel only offers 24 named longs as variables (plus a few others like SP, BC, FP, RI etc which normally have specific LMM uses) but that's because these are the only ones the C compiler needs to knows about - actually nothing to stop you adding more if you need them. Catalina also has an XMM loader that can load the kernel on boot (i.e. from EEPROM) and then start the Kernel executing a program directly from XMM. All you really need to do is replace the Catalina generated PASM code with your own hand-crafted PASM code.
@heater,
Hope your experience with Ada hasn't put you off too much. Ada is my all-time favorite language. People say that the learning curve is steep, but they tend not to mention that Ada also includes all the functions that are normally relegated to the system libraries, plus all the runtime support offered by an operating system or real-time kernel.
In reality, the learning curve of Ada is not as steep as <insert any language here> + <insert any set of standard library functions here> + <insert any operating system or kernel here>. I hope sometime soon to get time to put a subset of Ada on the Prop - but I don't think it will be a very large subset. Maybe on the Prop II.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Looks like we cross posted!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I do not want any HUB access unless explicitly called for by the ASM after startup except for a few longs used to accelerate the instruction fetches and some primitives that allow HUB access and provide buffer copy accelerators. I prefer the HUB be entirely available for the user after startup for things like video buffering or other data intensive applications.
I'll look at Catalina again especially as a Platform Environment for all the C lovers (includes me), but from what I remember, it is not really what I'm looking for. ImageCraft stuff is very restrictive in the kernel (to my needs at least), so I won't bother with that.
@heater thanks for the ADA offer, but that's not in my repertoire of languages, so I guess I'll pass. You may be happy to know that I've at least considered some emulation though [noparse]:)[/noparse]
Thanks,
--Steve
ADA is a big language, there is a lot in it.
I got stuck on the object oriented aspects of it. Just could not get my tagged records and polymorphism organized nicely.
I was relying on some very nice tutorials on the WEB by a professor from the states. He ended up describing ADA as "absurd" when his object oriented example code did not do what he expected. I eventually worked out that his example was wrong and was trying to do polymorphism in totally he wrong way.
At this point I concluded that if these features are so hard to use that a comp. sci. professor does not understand them then my life is to short to be trying to work with them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Let me know if there's anything I can do to help.
@heater,
Yes - Ada requires you to have a fair idea of the principles behind object orientation even before you start. C++ tries to hide the reality of OO from the programmer, whereas Ada puts it very much "in your face" - in part, I think that's deliberate on behalf of the Ada language designers - the features are there if you want them, but you'd better have a damn good reason for using them, because the run-time costs are very, very, high (something which most people don't seem to realize). Ada is also a bit obscure about the object oriented syntax - especially if you're not familiar with the whole Ada feature set, and start out using the wrong constructs. Many things that need OO solutions in other languages have better non-OO solutions in Ada - for example, don't use polymorphism to achieve something when generics can achieve the same thing but without the run-time overhead.
I find that in C (or C++) you can get any program to compile in a few minutes, but you typically then spend a year getting it to work properly. In Ada you can easily spend days just getting your program to compile (and you sometimes need to redesign it to do so!) - but once you do, it quite often just works. When you first see this phenomenon on a large, complex, multi-person project you tend to congratulate yourselves on how good a team of programmers you must be. After a while you realize most of it is down to the language itself - and the fact that you no longer have to fight with poorly designed and poorly implemented operating systems.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
See mikronauts.com/software-products/las-largos-lmm-assembler/
There will probably be a new release in a month or two, as I use LAS to assemble the code PropellerBasic generates.
Best Regards,
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Do you have a functional example test application like "Hello World!" I can study?
The kernel primitives sound simple, but an example of that would be an excellent start.
Firm examples are good for sanity check and helping decipher unexpected behavior.
Is LIBCALL a "user" primitive?
Thanks,
--Steve
humanoido
It generates a bin file and a list file automatically.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Yep, I hear what you say about ADA. I think one of the biggest problems in getting into ADA is actually the language that is used to talk about it rather than ADA itself. "incomplete types" rather than "virtuall classes" or whatever. That's a big hurdle when coming from a C/C++ experience. I did find somewhere and "ADA for C++" programmers site that attempted to overcome this.
I do like the idea that ADA is fussy. In the old days you could throw any "line noise" at a C compiler and end up with an executable. Then what? Break out the debugger and and spend a week finding out what it really does[noparse]:)[/noparse]
On the other hand having to rewrite everything to get what I really mean to compile takes a lot of work.
What you say is quite encouraging, I may revisit my assembler one day. If only as an ADA exercise. Shame to throw it away as encoded in there is a lot of stuff about parsing the quirky spin syntax.
ADA on the Prop would be an amazing feat. Years ago we used ADA on the 16 bit Intel 186 chips. Three of them in a hand held box. There is even an ADA for AVR and an ADA for the Z80 so it must be doable to some level.
If I understand correctly there are already some ADA subsets defined for smaller real-time systems. "Spark ADA", is it, for example.
@Humanoido,
I thought your ears would be pricking up at this[noparse]:)[/noparse]
No my assembler, written in ADA, was to be run on a PC to generate COG code from normal Spin files as input. Ignoring any actual Spin language it was to understand PASM and VAR and CON sections etc.
Looks like RossH is looking at another item for your list though [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Yes, "Spark Ada" is a subset of Ada. I've never used it, but it is not primarily for small systems. It is the subset of the Ada language that is formally verifiable (e.g. using an automated program prover). Ada has some non-deterministic aspects - such as some of the tasking constructs - that I believe have to be disallowed if you want to formally prove that the program will accomplish its goal in some finite time. It is used in ultra-ultra-critical systems where it has to be formally shown that the program does exactly the job it was designed for (and nothing else) before it is allowed to be deployed.
I also had my first Ada compiler on a single 80x86 - ran quite well, as far as I can remember.
I don't know that I'll be the one to do it, but I'm fairly sure we'll get it on the Prop someday!
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I look forward to an update. Please post a link when ready.
Thanks
Examples will be coming soon.
I am currently swamped with work (two "rush" consulting gigs (industrial, Propeller based), PropellerBasic, prototype PCB's for four new products coming in over next couple of weeks... oops did that slip out?)
Please note PropellerBasic will be generating .las files with the basic code as a comment followed by the LMM assembly code for it, it will be a great way of making examples
SYSCALL is for calling Largos system services (stdio, file system, etc)
LIBCALL is for calling user library routines
I still intend to release a "preview" of PropellerBasic, with some docs, on Dec.24 of this year
(sleep is optional, and working so much would risk my marriage if I did not have such a terrific, understanding, wifey)
Some time before then I can post a few simple .las files, things like blinking an LED.
Best Regards,
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Having a kernel compatible with your Basic or any other LAS emitter would be useful.
What is your current XMM MIPS rate on a 10ns SRAM Morpheus? Just curious [noparse]:)[/noparse]
I see you adopted our 8 instruction long fetcher in your cache reader ... nice work.
@RossH will you be emitting LAS with Catalina?
Thanks.
I haven't decided yet - I intend having a look at LAS when it is a bit more mature. It certainly won't be in the initial release of Catalina for Morpheus (which should be out Real Soon NowTM).
One thing I'm finding is that as Catalina supports more and more platforms, I'm making much slower progress on the core functionality. This is because of the complexity of the platform-specific code for the more complex XMM multi-prop platforms like the TriBladeProp and Morhpeus. Morpheus on Homespun is in progress (and I'll finish it if it kills me!) but also supporting Morpheus on LAS may simply be a bridge too far.
Nothing to stop someone else doing it, of course - the Catalina code generator and binder (which are the components that would need to change) are fully GPL'd.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
XMM MIPS on 10ns ram... have not done it yet, but I have a crazy idea for a five-cog cache engine that might get XLMM to be almost as fast as LMM from the hub [noparse]:)[/noparse]
And I have some truly insane ideas for Morpheus 2 (Prop2 version of Morpheus).
Yes, thanks, I did Great work guys.
Actually I adopted it twice, and interleaved it - that's how I get 20MB/sec bursts from my XMM for frame buffer refresh! (with a third cog supplying some address information)
With the 10ns ram, and two more cogs, I believe I can easily do 40MB/sec bursts, and 80MB/sec is not entirely out of the question.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
There is a version of ADA that runs on the Propeller. As you may have guessed it runs under CP/M under ZiCog[noparse]:)[/noparse] It is the Janus ADA compiler. If you want to play with it I could put some instructions together. Yep, with WordStar now working on the Prop you can develop ADA code on the Prop!
My attempt at a Prop assembler is compiled and run on the PC. It is far to big for Janus on a Z80 with 64K RAM I think. Besides it is written in a much more recent dialect of ADA than Janus supports. I suspect Janus only ever implemented a subset of ADA anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
java -jar pPropellerSim <nameofthefile>
A file with extension ".bin" and another one with ".lst" are created matching the
name of the source.
The error message is displayed and written to the list file too.
I have to peek into Bill's LAS to see which features I can implement.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Thanks for that. I was able to start the program, but have not used it yet.
I have an LMM interpreter I can use for testing with your program maybe Friday.
@Bill,
I'm attaching a "blinky.asm" that I think should work. LAS compiles, but the .lst output is mysterious.
Have a look and fix it if you have time.
Slipping into holiday mode now. Happy Thanksgiving!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Happy Thanksgiving!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Happy Thanksgiving!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller