Here's some thoughts on this subject from a VERY competent friend with great experience in both HLLs & assembler. Russell McMahon _______________________________________ To: "Russell McMahon" Sent: Sunday, April 21, 2002 11:41 AM Subject: RE: [PIC]: Assembler versus High level languages <-- Re: [PIC]:c interrupts > HLL's and assembler are simply tools to achieve an end and each has its > place. > > I liken them to the difference between a handsaw and power-saw saw. One is > ideal for doing a lot of general work with great efficiency. The other is > essential for fine finishing and high craftsmanship. Sometimes you need to > use both to do a job properly. So much for the Zen of programming. > > I use both extensively, however when you need to get a lot of functionality > into the smallest possible code space in an embedded microcontroller (and > have the time to do it), HLL's cannot compete with working in assembler > (although thay can still be great for prototyping code). We routinely deal > with what are widely regarded as the best optimising compilers for several > 8-bit and 16-bit microcontroller families and (despite what their vendors > say), they cannot even come close to the compactness of code we can achieve > in assembler on a good day. > > In one case in point, we re-coded the code for a mature medium-volume > domestic appliance originally (competently) written in C, in hand-crafted > assembler. We reduced the code size to 43% of the original size (and added > some new features and functionality along the way including in-built support > for factory testing). It took about 19 weeks. It allowed the manufacturer > of the appliance to drop down two memory sizes (from a 32k-byte 8051 variant > to an 8k variant), and saved them around US$1.30 per unit. On the basis of > their production volumes, our efforts will repay their investment in a > couple of months (less time than it took us to do it). > > It was right that the code should have originally been written in C. That > minimised the original development time and allowed changes to be made > readily as the product evolved and matured. Once the product design was > stable and production volumes were up, it made sense to use assembler. > > It all depends on the nature of the application - there is no one rule. > > Regards, > > Ken Mardle -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body