Maarten Hofman wrote: > Instead of remembering, it might be good to read the actual code. Yes it would be, and I would have if the code hadn't been on another machine 20 miles away where I downloaded it some hours earlier. > The > movfw instruction in question was meant to restore the STATUS word to > its original value. If that is correct, then I agree that MOVFW is a problem. > However, I design my > applications in advance, and know exactly which PICmicro is going to > run it. Sigh, where to start? ... First, sooner or later you, or maybe someone else, will try to use that code on another PIC. Code takes on a life of its own. The argument for doing this right is not much different from the one for proper commenting and readable style. I think the best argument though is that the source code should describe what to do and what the requirments are, and the linker file should define the memory layout of that particular PIC. If it's not obvious why that's a good idea then I might as well give up. > So creating it such that I can easily change the PICmicro to > another type seems like a lot of overhead to me. What overhead? Nothing I've suggested is more difficult, only smarter. > But then, I'm not > really into this "relocatable code" anyway. That's another bad habit you should fix. > I believe this wasn't a discussion on how things should > be, but a question to have a problem solved. First, I can comment on anything I like. Second, just because some of the things I pointed out didn't in fact cause the problem originally asked about doesn't make them any less bugs waiting to happen. Newbies seem to pick up bad habits early, then stick to them. It's important to get people down the right path as soon as possible. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist