C Compiler for SX
inaki
Posts: 262
Is there any cheap C compiler IDE for SX·?
I know people that·is using MPLAB··but one cannot debug within MPLAB IDE.
The Bytecraft SXC is too expensive.
Anyone there is using any·C compiler as a regular tool for SX development ?
·
I know people that·is using MPLAB··but one cannot debug within MPLAB IDE.
The Bytecraft SXC is too expensive.
Anyone there is using any·C compiler as a regular tool for SX development ?
·
Comments
http://www.picant.com/c2c/c.html
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
The smallc port converts C to ASM. While I can debug the ASM version, what I want to debug is the C version, not the ASM one. I can get a similar effect compiling to ASM in MPLAB.
What I want is some IDE similar to MPLAB that allows me to debug in C within the IDE. In other words I want something similar to MPLAB with a C compiler. I suppose Bytecraft does all that, judging it for its price.
I am pretty positive it would be possible to make a SX-Key pluggin for MPLAB for debugging. Anyone ?
I come from 12 years of C/C++ and when I started using the SX a thought
"if only I could code in C I could crank out the code".
I'll save you the trouble, learn ASM/SASM.
I kept reading that advice in these forums and shrugged if off. But they are right.
Even if you did use C its not the C you are thinking of. It is as cryptic a ASM.
Same for SX/B. Parallax did a great job with SX Basic but I think they would be
the first to tell you it is only to wean basic users into ASM.
I'm learning ASM now and it really is not that hard.
Instead of :
If(I < 20)
DoSomething
its:
CJAE I, #20, GoSomeWhereElse
DoSomething
CJAE is "Compare, Jump if above or equal". In this case jump to GoSomeWhereElse.
Anyway, just my advice.
Now, if I could just nail Arrays in ASM. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jack
That is one use of SX/B. Make a simple little program that uses arrays. Then see what code SX/B generates and learn from it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
There you go Bean, good Idea.
Although I did just now post a new topic on the question. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jack
So as Jack put it learn assembly if you still want to use C after that you'll be able to at least make heads or tails of the compiler's output.
Just my $0.02.
Chris
I have the CCS compiler, and so far I'm not impressed. Since I have been using SX assembly for many years now, I can out code the compiler by almost a factor of 2 for ROM space, and sometimes a factor of 3 in variable space. Granted, the compiler does not know what tricks I'm up to, but then it's the job of a good compiler to figure that out.
My principal compiler need was for convenient floating point math routines, and I found them too bloated and wasteful of RAM. Doing some fairly basic FP math in an SX28 doesn't leave much ROM nor RAM memory for the main tasks of the program. In my opinion its useless for an SX28. The SX48/52 of course will fare a bit better.
So far I have rewritten a few of the FP routines in assembler, and compacted the code considerably as well as the RAM. The speed has also gone up significantly. I believe that I will be able to get quite a compact set of FP math routines (re)written, then I'll shelve the compiler permanently.
Do realize though that the compiler from CCS is really geared to the PIC family, and the SX version is a bit of a wart. Support for this version is very poor; e-mailed requests are form-answered by a machine, and then you never hear again from them. Product updates for PIC are frequent, but extending those enhancements to SX happen only if you whine. Lots of bugs that clearly are a result of carelesness or lack of understanding the SX architecture. How tough can a clear-ram routine be?
On the positive, telephone calls are answered by a considerate and helpful person.
Having gone through this experience makes me a staunch believer in the applicability of assember for the SX.
Man, can you ever make that puppy put out!
Cheers,
Peter (pjv)
Let me tell you that I do know assembler already. However assembler is not the best way to do complex progams in my opinion. And yes, I like to watch the code in assembler from time to time, even if I am working in C.
So far the only interesting thing I can see on the SX family is speed which is very interesting to have but is not the only thing to have.
I like the Parallax tools in general and appreciate its simplicity, clear docuementation and excellent support. Even after 25 years of programming I can realize that these tools are not only for beginners but are a joy to use for anyone. The SX/B tool is great, although debugging is impossible. It is pretty odd that one requests to an average user to switch from Basic to ASM for debugging!
So, for serious development I think I will stay with PICs. For fun I will continue to use Parallax tools.
Would you be willing to share your FP routines ? Please...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
I suppose so, but first I need to do a bunch more work on them, and right now my priorities are on a different front. Actually they are required for the project I'm currently working on, but are further down in the priorty list. It'll be a while.
Peter (pjv)