First ideas of PASM virtual machine
Goal: execute PASM from main RAM or external RAM attached to Propeller.
Idea (in pseudocode, I didn’t memorize PASM syntax yet)
Related Forum Messages
Hi, I have a method (actually two) that are written in spin, they works well but they are too slow for what I need. Unfortunately they involve a lot of math and I'd like to add even more math, and from what I've read in the manual, PASM math/comparisons are pretty difficult for a PASM beginner. Also I'm about to start trying to translate them to PASM and I'm used to troubleshooting with the PST, how do you debug PASM? Code:I have PASM running in a COG. I'd like to share the COG process across multiple objects, like a static method. I'd have to carve out HUB memory so the other methods could access the PASM process through interface pointers. That would create dependencies between objects at run time. I'm thinking that I'll have to have as many instances of the PASM processes (COGs) as I have PASM consumer objects. Is that correct?I'm not going to be near any real hardware for a few days to try but will this code snippet allow me to end up with 8 COGs all running PASM... coginit(1,@cog1_pasm,0) coginit(2,@cog2_pasm,0) coginit(3,@cog3_pasm,0) coginit(4,@cog4_pasm,0) coginit(5,@cog5_pasm,0) coginit(6,@cog6_pasm,0) coginit(7,@cog7_pasm,0) coginit(0,@cog0_pasm,0) ...where "cogx_pasm" points to my pasm code? I'm just not sure about that last line. I know it's going to overwrite the running SPIN interpreter but is it a 'clean' switch over to the running PASM?I have a sensor that has an analog output and some Propeller code that uses sigma delta analog conversion to interface with it. I want to port the code to the Prop Boe and use its on-board ADC instead. If this was Spin code I could do it pretty easily, but the original code is in PASM, which I've been avoiding for a while now. I used to program in assembler back in the 80's, so I bit the bullet and read through the code. I found it relatively straight forward with a few bits I was clueless on. I think ...The Propeller manual states that FRQA can be used as any other regular register, however I'm apparently seeing different behavior in PASM on FRQA when using it in ADD, SUB or CMP statements. Any experience on this? AlexEDIT: This thread is solved and I've posted a demo program that is related to the discussion in this thread... http://wardyprojects.blogspot.co.uk/2012/04/propeller-programming-8-cogs-running.html --------------------------------------------------------------------------------------------------------------------------------------------------- I'm making Cog 0 run a "bootstrapper" written in PASM. So far so good, that works. What I am having trouble with is starting another cog (cog 7 in fact, not that it's important) from within the bootstrapper code using the coginit instruction in PASM. The PASM code I want to put in cog 7 never runs so I must be constructing the bit fields incorrectly, so cog 7 never starts up. I've carefully checked the field alignments and I believe them to ...Through searching, I saw an example that used frqa and phsa, but I tried that and it did not work and then I realized I am already using frqa and frqb as counters for something else In spin I would do something like (cnt-timeStamp gt clkfreq) I tried to do the same in pasm, but I don't know if this is a legal operation, I tried to do something with sub, but that didn't work either. Also, do I have to use if_C_OR_Z for each line after a compare, since there is no indentation or brackets in pasm? gapCntAsm is just an ...I decided it was time to spend a little more effort on my quadrotor. One thing I've been wanting to do is convert the i2c gyro reading code from Spin to PASM. I took a bunch of code from the sdspiFemto routines by Mike Green, added some setup code, twiddled some things, and got.... nothing. I spent a decent amount of time debugging, using my oscilloscope and various "write intermediate to hub ram" methods, but wasn't really getting anywhere. I captured images of the scope readings and compared them between the PASM (slowed down) and the Spin versions. Everything looked fine. Then ...All three of these lines of code generate this error. Through searching I saw that some were setting constants, to an up to 31 bit signed value and then using cmp or mov with a pointer to that address. I can't do that with my code, as I'm doing math based on changing variables. How do you handle large equations with variables in PASM, that are larger than 9 bits? For additional information, they have to be done real time, and can't be set in spin before I launch the PASM cog. Thanks for reading. Code:I don't have a meter to check this right now, but am curious about something. I have set a debug section in PASM to monitor ina: Code:Hi All; I'm still learning Spin here, so I may be not on the best path... What I'm trying to do is to load several PASM objects into a single PASM cog. The loading (Spin) cog will pull the objects in sequentially as they are listed. Inbetween the loaded objects appear the object header(s) which don't seem to cause much of a problem. What I am not finding an easy solution for is that each object gets compiled with an ORG of 0, and since they are located sequentially into the operating cog, the object's address references are messed up. I'm wanting ...Scenario: Two pasm cogs doing different things, I want to have a third that compares a few pieces of data from each and does some calculations In trying to figure this out on my own, I would imagine I have to pass a hub ram address to the 3rd comparative cog or call a get command that returns a result. Can I call method.getResult inside of PASM and bypass spin? I'd like to bypass SPIN altogether for speed purposes. Do I have to go through hub ram to share cog data between cogs? I would think there is a way I ...I started having my PASM fit command tell me that I had exceeded 492 longs, so now I'm trying to trim out the waste in my code. I'm wondering how I read this object info window and if I can reconcile it to just the PASM code? Is there a way to move the output of the fit command so that I can print it to the PST? Thanks for reading.Here is a simple on chip PASM debugger. The BMAdebugger does not use a GUI. Debugging is most effective when used in conjunction with BSTC compiler .list files. - Small and simple on chip PASM debugger - No Windows or other PC program required - Feature rich command set - Multi-COG debug ability You do not need previous versions. The latest version is the one to download/use. [size=2] Code:After posting my thread about converting spin to C/C++, I noticed a "related thread" about converting spin to PASM. For very simple spin objects that is now possible using a combination of propgcc and spin2cpp. The output isn't very good PASM, of course, but as they say of talking dogs, it's not how well it does it but that it does it at all :-). For quick and dirty projects it may be a good starting point for hand optimization. For example consider the led toggle program: Code:I am working on a Propeller Professional Development Board using button Zero and LED 9. Both programs work as coded, but with this one puzzling result. When I run the PASM code and while it is waiting for the a button press the LED is dimly lit. When you press and hold the button the LED is brightly lit as you would expect. Release the button and the LED returns to the dimly lit state. The SPIN code works as well, but the LED is off until the button is pressed and held. I'm returning to working with PASM because ...Hey guys, A question about the PASM version of COGINIT. The Prop Manual version 1.2 says that the destination register of COGINIT is a 32-bit field which is supposed to hold PAR, start up address, and other information about the start-up cog. I thought that the destination and source fields of PASM only allowed for 9-bit values. What am I missing?I wonder how many of you fellow forum members do a sizeable amount of PASM coding. I've been battling with it a fair bit lately and honestly I find it a pain in the arse. I can see several areas where the Propeller Tool (lovely and $free though it is) falls down pathetically where debugging PASM is required. I feel like I'm having to "help" the tool rather than the tool helping me. It's a fight to see who breaks first. After having finally won my latest battle with the Prop Tool's assembler quirks, I'm sufficiently frustrated with the amount of time ...I have been looking at a thread in the "Prop GCC Beta" forum and apparently the comment I am going to make would be better put here. My comment is to Parallax and to anybody involved with "SimpleIDE". Even though I am just a hobbiest and haven't purchased a quantity of Propeller chips, I completely understand the need to include C/C++ and I can kind of understand why it was not included with the Propeller 1 to begin with though it should have been from a business standpoint. As the Propeller is a unique chip and you are offering it thru ...I was wonder if some Spin/PASM experts would mind casting their expert eye over the following code with a view to separating the Spin part from the PASM part. This is with a view to creating self contained pasm code that can be loaded and reloaded many times by a program, and also with the idea of replacing the Spin part with Propbasic or C or any other language, but keeping the Pasm part the same, and also as a way of saving up to 14k of hub ram by loading the pasm part of cog code through the same 2k ...
- Looking to translate spin to PASM
- Question: PASM, COG, and Static methods
- Stoping Running SPIN to allow 8 PASM COGs
- Anyone have examples of using the Prop Boe’s ADC from PASM?
- PASM: Can I add/sub/cmp on FRQA/B??
- Solved [PASM] Can’t get Coginit instruction to work
- How do you calculate if delta time has elapsed in PASM?
- Kudos to PASD
- Problem with PASM: “Source register/constant cannot exceed $1FF”
- INA behavior in PASM
- Multiple PASM Objects Into One PASM Cog
- How can I share data in between cogs in PASM?
- Solved How do you read the object info screen? (how to proactively calculate PASM code size)
- BMA Multi-COG PASM Debugger V1.91 Now Available
- Automatically convert spin to PASM
- Solved Why the difference between these two button reading programs in PASM and SPIN
- COGINIT’s Dest Field [PASM]
- Opinions requested: How about a PASM-centric coding environment?
- SimpleIDE’s “spin-y-ness”
- A request for help pulling a perfectly good object to bits!