SECTION III-8: MOVFF Instruction in the PIC micro-controller

The MOVFF instruction copies data from one location in fileReg to another location in fileReg. The fileReg location for source and destination can be any of the 4096 locations in the data RAM space of the PIC18. The MOVFF instruction allows us to move data within the 4K space of the data RAM without going through the WREG register

Moving Data Directly Among the fileReg Locations:
movff-instruction-pic-microcontroller.jpg
Program to get data from the Special function registers of Port B and send it to the Special function registers of PORT C continuously using MOVFF
AGAIN MOVFF PORTB, PORTC ;copy data from Port B to Port C
GOTO AGAIN ;keep doing it forever
Compare below MOVFF with MOVF
AGAIN MOVF PORTB, W ;bring data from Port B into WREG
            MOVWF PORTC ;send it to Port C
            GOTO AGAIN ;keep dong it forever
Using MOVFF we simply copy data from one location to another location. But when we use WREG we can perform arithmetic and logic operations on data before it is moved.

 

More From Iamtechnical.com

Advertisement:

SiteLock