Menu

#298 STATUS OV flag being set when it should not

open
nobody
3
2025-03-29
2025-03-27
Anonymous
No

Dear Mainteiners,

The attached code adds bytes 0x3e and 0xd7. I think it should not set the OV bit of the STATUS, but it does after the addwf.

It sets STATUS to 0x0b and it should be 0x03. Am I wrong?

Thank you,

Alvaro

PS: gpsim version:
gpsim -v
gpsim-0.31.0 # (Aug 17 2021)

1 Attachments

Discussion

  • Roy Rankin

    Roy Rankin - 2025-03-28

    Current operation looks correct to me,
    0x3e + 0xd7 = 0x115 so bit 7 has overflowed and therefor I would expect the OV bit to be set.
    Can anyone check on the real hardware what the processor does?

     
  • Anonymous

    Anonymous - 2025-03-29

    Hi Roy,

    I think C bit should be set, but not OV bit since it does not overflow in signed arithmetic. I could not try on hardware, but used MPLAB and it does not set it.

    See attached shot.

    Regards,

    Alvaro

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB