PLUSW instruction. PIC18F2221

Discussion in 'Embedded Systems and Microcontrollers' started by MaxHeadRoom, Aug 17, 2013.

  1. MaxHeadRoom

    Thread Starter Expert

    Jul 18, 2013
    10,537
    2,369
    I haven't used the PLUSW0 instruction yet, but looking in different forums there seems to be some dispute as to whether the definition in the manuals is correct?
    'Value of FSR0 pr-incremented, value of FSR offset by W'
    Some say it is not incremented, others the opposite.
    Anybody have any experience?
    Max.
     
  2. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Hi Max,

    I've used it before. What exactly do you want to know?

    Mike
     
  3. MaxHeadRoom

    Thread Starter Expert

    Jul 18, 2013
    10,537
    2,369
    To verify if the FSR0 pre-increment statement True or False?
    The way I read it the FSR0 is just offset by the WREG the FSR is not otherwise affected ?
    Max.
     
  4. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Can you post the entire statement. The one you posted in the first post seems incomplete or out of context?
     
  5. MaxHeadRoom

    Thread Starter Expert

    Jul 18, 2013
    10,537
    2,369
    This is virtually all there is in the manual.

    PLUSW0 Uses contents of FSR0 to address data memory - value of FSR0 pre-incremented (not a physical register) -Value of FSR0 offset by W

    • PLUSW: adds the signed value of the W register (range of -127 to 128) to that of the FSR and uses the new value in the operation.

    I also understand that the command does not change or affect the existing FSR0 itself? although the first statement seems to contradict it?
    Max.
     
  6. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Yeah, the statement doesn't make sense and I couldn't find anything like that in one of the 18F' datasheets I have on hand here.

    Your understanding is correct. That is, the FSRx pair is not affected by use of the PLUSWx operand.
     
    MaxHeadRoom likes this.
  7. MaxHeadRoom

    Thread Starter Expert

    Jul 18, 2013
    10,537
    2,369
     
Loading...