Hot!addwf doesn't set carry ?

Author
AleMala
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2018/10/07 15:30:17
  • Location: 0
  • Status: offline
2018/10/09 16:46:43 (permalink)
0

addwf doesn't set carry ?

I am using MPLABX v 5.00 emulator and i had to use different instructions couse
the following code doesn't work:
      
     MOVIW INDF0++
     ADDWF INDF0,W
     RRF WREG,W

the problem is the second (ADDWF)  that doesn't change the carry flag ?
Help welcome! Alessandro.
#1

6 Replies Related Threads

    GeorgePauley
    Moderator
    • Total Posts : 1001
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: addwf doesn't set carry ? 2018/10/10 08:33:08 (permalink)
    +2 (2)
    What device
    #2
    AleMala
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2018/10/07 15:30:17
    • Location: 0
    • Status: offline
    Re: addwf doesn't set carry ? 2018/10/10 15:56:51 (permalink)
    0
    MPLABX v 5.00 emulator for pic16f1459.
    #3
    qhb
    Superb Member
    • Total Posts : 7090
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Flagged as Spam (1)
    Re: addwf doesn't set carry ? 2018/10/10 16:18:09 (permalink)
    0 (2)
    MPLABX 5.05 has been out for a while now.
     

    Worst forum problems are now fixed, but the damn firewall is still there.
    #4
    GeorgePauley
    Moderator
    • Total Posts : 1001
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: addwf doesn't set carry ? 2018/10/11 11:09:32 (permalink)
    +3 (3)
    I just ran this and saw the carry flag set.  Are you sure the input values to the ADDWF are what you think they are?
     
        MOVLW 0x00
        MOVWF FSR0H
        MOVLW 0x65
        MOVWF FSR0L
        MOVLW 0xFF
        MOVWF 0x65
        ADDWF INDF0,W
     
    #5
    AleMala
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2018/10/07 15:30:17
    • Location: 0
    • Status: offline
    Re: addwf doesn't set carry ? 2018/10/11 16:29:17 (permalink)
    0
    I try your code and it sets the carry properly !
    I will install the new version 5.05 and check.
    Regards, Alessandro
    #6
    AleMala
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2018/10/07 15:30:17
    • Location: 0
    • Status: offline
    Re: addwf doesn't set carry ? 2018/10/13 13:22:47 (permalink)
    0
    You are right, I try this code and everything works fine.
    MOVLW 0x00
    MOVWF FSR0H
    MOVLW 0x65
    MOVWF FSR0L
    MOVLW 0x1
    MOVWF 0x65
    MOVWF 0x66
    BSF STATUS,0
    MOVIW INDF0++
    ADDWF INDF0,W

    By the way, i remember now that after some errors i installed a newer underlying java machine.
    But the most affordable option may be i was drunk !!!
    Excuse me, Alessandro.
    #7
    Jump to:
    © 2018 APG vNext Commercial Version 4.5