Why all the NOPs with xc8 PRO?

Discussion in 'Programmer's Corner' started by Robin66, Oct 1, 2016.

  1. Robin66

    Thread Starter Member

    Jan 5, 2016
    102
    3
    Hi programmers. I'm coding in C in MPLAB x, compiling with xc8 pro, for a PIC18f2620. I'm seeing lots of NOPs in the disassembly. If I'd been compiling in lite mode I'd expect these. I don't see any reason for these according to the MULWF documentation. Can anyone shed any light on this?
    Code (Text):
    1.  
    2. 89:                           num+= 15*dErr;
    3. 12BC  0E0F     MOVLW 0xF
    4. 12BE  03B5     MULWF dErr, BANKED
    5. 12C0  CFF3     MOVFF PROD, 0x24
    6. 12C2  F024     NOP
    7. 12C4  CFF4     MOVFF PRODH, 0x25
    8. 12C6  F025     NOP
    9. 12C8  03B6     MULWF 0xB6, BANKED
    10. 12CA  50F3     MOVF PROD, W, ACCESS
     
  2. dannyf

    Well-Known Member

    Sep 13, 2015
    1,769
    357
    google OCG.
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    This is not a helpful suggestion, since the top ten hits have nothing to do with the TSs post.
     
  4. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,886
    375
    MOVFF is a two word instruction, the first word includes the source and the second includes the destination. The second word shows up in dis-assembly as an NOP. It is not just a waste of space-time.
     
    Robin66 likes this.
  5. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,886
    375
    I guess OCG is omniscient code generation but what does it have to do with the MOVFF instruction?
     
  6. Robin66

    Thread Starter Member

    Jan 5, 2016
    102
    3
    Thx Albert. I understand now
     
Loading...