libpdp12/linc.c
/*
 * Sign is stored in the highest bit, if op1 && op2 have the same sign
 * and the results have a different sign, then overflow has occured.
 */
Sign is stored in the highest bit, if op1 && op2 have the same sign
and the results have a different sign, then overflow has occured.
Sign is stored in the highest bit if op1 && op2 have the same sign and the results have a different sign then overflow has occured .
static void
check_overflow(cpu_instance_t *cpu, int op1, int op2, int res) {
    if ((op1 & 04000) == (op2 & 04000) &&
        (res & 04000) != (op1 & 04000))
        cpu_set_flag(cpu, CPU_FLAGS_FLO);
    else
        cpu_clear_flag(cpu, CPU_FLAGS_FLO);
}
static void check_overflow ( cpu_instance_t * cpu , int op1 , int op2 , int res ) { if ( ( op1 & 04000 ) == ( op2 & 04000 ) && ( res & 04000 ) != ( op1 & 04000 ) ) cpu_set_flag ( cpu , CPU_FLAGS_FLO ) ; else cpu_clear_flag ( cpu , CPU_FLAGS_FLO ) ; }
Sign is stored in the highest bit, if op1 && op2 have the same sign
 and the results have a different sign, then overflow has occured.
Sign is stored in the highest bit if op1 && op2 have the same sign and the results have a different sign then overflow has occured .