Need help adding P2 support to PropBASIC
Bean
Posts: 8,129
Hey everyone, I finally have some time to start adding Propeller 2 support to PropBASIC.
This is going to be a huge undertaken because I haven't been able to follow the P2 development.
I will have many questions as I proceed with this, so please be patient with me.
My first problem is how do I convert WAITPE and WAITPNE commands ?
Also, how do I set RCFAST clock mode ? _ClkMode = RCFAST gives "RCFAST" is "Undefined symbol" ?
Thanks, Bean
This is going to be a huge undertaken because I haven't been able to follow the P2 development.
I will have many questions as I proceed with this, so please be patient with me.
My first problem is how do I convert WAITPE and WAITPNE commands ?
Also, how do I set RCFAST clock mode ? _ClkMode = RCFAST gives "RCFAST" is "Undefined symbol" ?
Thanks, Bean
Comments
Bean
Sorry I cant help its all smoke and mirrors to me- even the 'brains' on the forum seem to be scratching their heads. But the news that you are considering producing a prop2basic is really exciting and I cant wait to help testing it out.
Dave
I think the biggest mysteries surround the inner workings of the HyperRAM chips.
I'm sure I could add PropBasic too, if you go that route...
Bean
p_LED57 and p_LED56 are mask values with only 1 bit set.
I am wanting to set pin p_LED56 to the same state as pin p_LED57.
Bean
Like this:
I am first just trying to get it to work the easiest way possible.
Later I will go back and optimize for the P2 instructions.
Bean
Bean
It appears there are a few options, but is probably the simplest, but also sets the carry if count was already negative.
Out of interest, should count ever intentionally be negative, and if so should it be handled differently than zero?
(on P1, CMP is the same as SUB NR, but CMPS is NOT SUBS NR)
To actually set C if x is zero, use CMP x,#1 WC (on both P1 and P2)
But now I ran into a real problem...
PNut does not seem to support the @@@ operator. Is there any assembler for the P2 that supports @@@ ?
Bean
Agreed. It makes one wonder whether the code or the comment is correct. More context (and maybe more coffee before posting ;-) is needed.
Bean, can you show an example of your code that uses @@@. There may be a simple work-around.
On the P2 is there a shorter method than
Thanks, Bean.
I think, no. This isn't even enough. There is an issue that waitpat will not stop waiting if the condition (pattern match) is already met before waitpat is started. So you have to check the condition and skip the waitpat if it's true. This is one of the few things that were solved better on the P1.
Bean
Forgive me if I misunderstood but doesn't FlexBasic still need to perform GC?
What I love about PropBasic is that it translates directly to PASM.
@Bean, fastspin does support @@@ and Ive used it in the past to compile propbasic code for p1, so it should work well for you as a p2 assembler. I would be grateful if you could give its basic dialect a try too, if only so that we could discuss ways of making p2 basics more compatible with each other. The gui for fastspin (FlexGui) is linked to in my sig, but the fastspin assembler/compiler can be used on its own without the gui.