> > There are three common ways to do a subtract,Microchip uses > > one of them in the PIC's and 6502 and 6805 use the other two. > > They all treat the carry different. This is the main reason that > > assembly code cannot be easily translated with macros from > > one processor to the next. > well, yes, but most mortals want to subtract literal x from the value y > in the accumulator, not the other way round, and to be honest I've never > seen another microcontroller with such a strange instruction. Apparently > it allegedly has a use, but what that is I can't remember. You end up > doing addlw -20 which hardly helps readability. Or defining a macro. It is true that sublw is used much less frequently than addlw; it would not be a particular loss had Microchip omitted it from the instruction set. On the other hand, there would be little reason for Microchip to spend silicon on an instruction which--as you acknowlege--can be done just as well with an assembler macro (which requires no silicon). For the "subwf" instruction, the operation [result=f-w] seems odd unless you consider that, in practice, people are often going to want to subtract one variable from another. This takes two instructions on the PIC: movf source,w subwf dest,f ; dest=dest-source whereas if the instruction were instead "subfw" it would take three ins- tructions: movf dest,w subfw source,w ; Note: not a real PIC instruction movwf dest While I acknowlege that "subfw reg,w" would be perhaps more useful than "subwf reg,w" the usefulness of "subwf reg,f" more than makes up for that. As for the carry flag on subtract, it's 6502-style rather than Intel-style but I don't see that as a real problem; you just need to remember how it works when you code it.