Hi there, Olin. I struggled with the decision to make my comments public, but your reply to my most recent message to you suggests that public might be the way to go: From: "Olin Lathrop" To: "Dwayne Reid" References: <327333.46946.qm@web50506.mail.re2.yahoo.com> <4B9146FE.8040608@sbcglobal.net> <4B915142.2040104@sbcglobal.net> <698781.27456.qm@web50503.mail.re2.yahoo.com> <4B91BDAD.10804@sbcglobal.net> <568545.81976.qm@web50503.mail.re2.yahoo.com> <4B93223B Subject: Re: [PIC] measuring 220V mains Date: Sat, 20 Mar 2010 10:06:12 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1983 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1983 > I don't want to pursue this very far, I just realized this is a private message, so there is no need for me to respond at all. At 07:41 AM 3/21/2010, Olin Lathrop wrote: >Josh Koffman wrote: > > Hi all. I've been looking at some of Andrew Warren's code at > > http://reocities.com/SiliconValley/2499/code.html > >I quick look shows this is really bad* code and nobody should be using it as >a example. It does prove (assuming it works), that the problem can be >easily solved. Start from the problem definition and write your own code. > >* Two immediately obvious problems. First, EQU is apparently used to define >constants that are later used as the addresses of memory locations. Second, >there is not a single comment in sight. With two major irresponsibilities >in such a small code snippet, you can't trust anything the author has to >say. The blanket statement you made above is rather short-sighted and completely un-called for. I'll make two observations: 1) The code that Andrew Warren wrote was most likely written BEFORE MPLAB had the capability of generating re-locatable code. EQU was THE way that you specified memory locations. CBLOCK was not available - the directive did not exist. I can send to you a copy of the early assembler that Microchip gave to me when I first started with PICs if you don't already have a copy. Look all you like - no ability to generate relocatable code. 2) Andy doesn't comment all of his code. That doesn't mean that its bad code. In fact, it doesn't mean anything at all except that he didn't comment his code. I'm jumping to Andy's defence for a couple of reasons: he's not around to defend himself and he has written some extremely good code - and shared it. I'll leave you with this thought: it was Andrew Warren who first told Microchip (and the world) how to safely save context when responding to an interrupt. That is: no one at Microchip could figure out how to save context without trashing W. Andrew was the person who came up the idea (swapf w) - and did it on the spur of the moment while in the midst of a conversation on the old Compuserve BBS. I could say much more but I'd be risking moderation . dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist