Converting Stamp/Pbasic to and SX/B
Edited 6/01/06 by originator the post made no sense
Updated version with help request
I have loaded a Pbasic program into SXkey, and then tried to run the simulator( I don't have an SX chip). It made me take out some obvious stuff, like AUXIO and MAINIO. I had to change "in1 to rb.0 etc" for a lot of pins. It also didn't like If (but1 =1) AND (but2 = 0) then ..... or similar lines containing AND's and OR's with () included. So, I went through and deleted all the AND (xx= xxx) and OR parts of those lines, knowing I'd come back later when I found out a way to write it in a way that SX/b wanted. It didn't like NIB, so I changed it to byte just to get through it.
Here are the basic contents of the 9 errors accumulated at the bottom of the editor:
Address 2009 is not within lower half of mem This was a Gosub(only 2 of 10 gave the error)
Address 2430 is not within lower half of mem This was a Gosub
Return not defined
Overwriting same program counter loc (I used counter many times for various counting needs, this was the NIB that got changed to BYTE mentioned earlier.
Address exceeds mem limit I didn't like a if xxx then LABEL command
No irc cal slow being used Ahould be easily solved
Since the Pbasic version was almost pretty much done and working, should I be encouraged that this was all I had to deal with mentioned earlier?
If it liked 99% of the lines, and I can solve the way around the AND, OR issue, plus the few other issues, once the simulator WORKS am I home free with a chip?
What is the way around the AND, OR lines? Also, why did it throw out on a few Gosubs?
Thanks for any pointers
Post Edited (originator99) : 6/1/2006 8:03:54 AM GMT
Updated version with help request
I have loaded a Pbasic program into SXkey, and then tried to run the simulator( I don't have an SX chip). It made me take out some obvious stuff, like AUXIO and MAINIO. I had to change "in1 to rb.0 etc" for a lot of pins. It also didn't like If (but1 =1) AND (but2 = 0) then ..... or similar lines containing AND's and OR's with () included. So, I went through and deleted all the AND (xx= xxx) and OR parts of those lines, knowing I'd come back later when I found out a way to write it in a way that SX/b wanted. It didn't like NIB, so I changed it to byte just to get through it.
Here are the basic contents of the 9 errors accumulated at the bottom of the editor:
Address 2009 is not within lower half of mem This was a Gosub(only 2 of 10 gave the error)
Address 2430 is not within lower half of mem This was a Gosub
Return not defined
Overwriting same program counter loc (I used counter many times for various counting needs, this was the NIB that got changed to BYTE mentioned earlier.
Address exceeds mem limit I didn't like a if xxx then LABEL command
No irc cal slow being used Ahould be easily solved
Since the Pbasic version was almost pretty much done and working, should I be encouraged that this was all I had to deal with mentioned earlier?
If it liked 99% of the lines, and I can solve the way around the AND, OR issue, plus the few other issues, once the simulator WORKS am I home free with a chip?
What is the way around the AND, OR lines? Also, why did it throw out on a few Gosubs?
Thanks for any pointers
Post Edited (originator99) : 6/1/2006 8:03:54 AM GMT
Comments
PBasic has more features, but sometimes interrupts are real handy.
The SX48 has twice the code space of the SX28.
To see the code generated by SX/B simply use RUN->LIST from the menu. You don't even have to have an SX or an SX programmer. Just download the free SX-Key IDE software.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·