On Sat, Mar 10, 2007 at 11:43:03AM -0800, Don French wrote: > I see a lot of posts on this list that indicate that people are programming >in Assembly. So, I wonder why. Several reasons: 1) The first is simple "You love what you learn." Most folks wander into PICs reading projects and tutorials on the Internet. Most are targeted for 16F84A parts written in assembly. Another perfect example is that many many projects are still written is absolute assembler even though relocatable code linked together with the linker is easier to manage. 2) C on microcontrollers is generally nonstandard. So you can't just use a standard C, but one augmented with pragmas and other nonstandard fare. 3) Assembly is the PIC lingua franca. It's used to communicate ideas and concepts. Most of the Tech notes and virtually all of the code in the datasheets and the family language references are in assembly. > Except for really tight timing situations, >why not use C, which is one heck of a lot easier to write, read, maintain, >etc.? Again debatable. Simple example: Write code that clears bit 6 of variable i. Not so easy in standard C. Something like: i &= ~(1<<6); Whereas PIC assembly has the more straightforward: bcf i,6 This one point aggravated me enough that when I was working on my PIC high level compiler I specifically added a bit select operator. In NPCI this would be written: i:6 = 0; Also C is great if you already know it. If not then you have a bit of a learning curve to tackle. > And the optimizing compilers probably do at least as good a job of >saving bytes as most people can do by writing in Assembly. So, what is the > point? > See above. It isn't cut and dried. The other issue is that each and every high level language community is fragmented. Not everyone here knows Basic, C, Python, Jal, and all the other languages that are around for the PIC. Assembly is a common thread. Therefore it has value. BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist