> -----Original Message----- > From: WEBB,TIM (A-Sonoma,ex1) [mailto:tim_webb@AGILENT.COM] > Sent: Wednesday, December 19, 2001 2:58 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: Moving from f to f register > > > So I can: > > movwf f move w to f > movf f, w move f to w > keep in mind that 'f' has a special meaning if you use the include file (which you should use): it means the destination is a file register. the assembler substitues a '1' for the 'f'. In the example, i guess it would move register #1 (TMR0) to w, then w back to register #1. That's probably not what you had in mind. If you aren't using the include file, then this doesn't apply. > But can I: > > movf f1, f2 move f1, f2 > > MPLAB says: Warning[202] Argument out of range. Least > significant bits > used. > you can't do this. well, you can, but the results won't be what you intended. the second argument (f2 in your example) specifies the destination. However, the destination can only be one of two values: 0 or 1. a zero means store it in W. a 1 means store it in file register. In the example, f2 has some address, and the assembler substituted the address of f2. That of course is illegal, because the destination must be 0 or 1. > Or do I have to: > > movf f1, w move f1 to w > movwf f2 move w to f2 > > No warnings here.... > yup, to move one register to another, you have to go through the w register. here's yet another summary of movf. It assumes you are using the include file: movf , is the register you want to move. is where you want to put the result. *BUT* the can only be f (1) or w (0). that means you can move the register to itself, or to the working register. And that's it. BTW, this information is in the datasheet, it's just a matter of learning the language. To most of us, it's self-explanatory. But not to everyone. Hope this clears things up. > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics