>> From: John Dammeyer >> [cut] >> No complete implimentation of an HLL like C can run with so >> little code and data space. That was one of the first things I had to >> re-orient myself to. I wasn't writing in C I was writing in a simple >> Algorithmic language that had much of the syntax of C. Only then did I >> become more productive and have fewer problems. I agree >> For example, It's just not worth passing parameters to functions in most >> cases. The two byte size parameters are immediately placed into the W and >> the FSR, then your function is called and then inside your function put into >> the local RAM storage. Except you can't overlay that RAM with any other >> locals so it's gone forever. Takes less code to just set the parameters >> into overlayed locals yourself and then call the function ala assembler. >> Not as neat but takes less space. That's correct, but that's only a problem of MPLAB-C and not a problem with C in general! >...all of which ties in nicely with my usual recommendation to stick >with assembler for small microcontrollers - especially the ones with >less RAM than a BULL paddock. Precisely in this case a professional (!) C-compiler/Linker might help you overlaying lokal variables. >Tell me, what is the point of interposing another layer of inscrutable >software between you and the machine? The PIC has a wonderful RISC >flavour; you can learn all its instructions in a few hours. Better >to spend time doing this rather than bashing your head against a wall >trying to figure out what the compiler has done to your nice algorithm. It's very amazing to learn (after hours of searching for a runtime-problem) that the DECF affects the status and DECFSZ isn't, as well as MOVF sets the Z-Flag and MOVWF doesn't. ;-) >Also, tell me what is the point of using a language which is so nobbled >by limitations of the machine? C without a stack, heap, float, qsort() >and int ((**)(void ***)) pointers is like (to quote a well known >Aussie song) a pub with no beer. I think C gives you the possibility to write maintainable source code if want to do this - as well as you can write unmaintainable programs too. >I say this in spite of having written over 100,000 lines of C (and >loving it). However, horses for courses and the horse for the PIC >course is Microchip Assembler, of course -- no offence to all the >compiler developers out there (you're doing a great job fellas, >don't give up on it just yet). Naturally, the assembler has to be >the dinkum one - not the yucky Intel lookalike or whatever it is. > >Regards, >SJH >Canberra, Australia I also use assembler if the performance with C isn't high enough. Regards, Marc Schmaeche ZAM-AZN Am Weichselgarten 7 91058 Erlangen (Germany) E-mail: ms@zam.nf.fh-nuernberg.de (Ger/Eng/Spa welcome)