Overflow Bit Algorithm

Discussion in 'Embedded Systems and Microcontrollers' started by aajasser, Feb 13, 2009.

  1. aajasser

    Thread Starter New Member

    Feb 13, 2009
    1
    0
    hi

    Is there any algorithm using which overflow bit can be detected for all kinds of numbers and operations (signed, unsigned, addition, etc)?
     
  2. Enliten

    Member

    Feb 10, 2009
    17
    0
    Not sure i fully understand what you are after. Are you wanting to do signed / unsigned addition etc - ALU style stuff?
     
  3. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    If the microprocessor has a status register, then there should be an overflow flag bit. Simply bit test for that flag.
     
Loading...