Exemplo n.º 1
0
int		main()
{
	CFTest();

	#if defined(__WIN32__)
		#ifdef __MWERKS__
			getc(stdin);
		#endif /* __MWERKS__ */
	#endif /* __WIN32__ */

	return 0;
}
Exemplo n.º 2
0
static  instruction *CmpRelocZero( instruction *ins, opcnt c, opcnt r )
/*********************************************************************/
{
    name        *cons;
    name        *rel;
    bool        truth;

    if( OpcodeNumOperands( ins ) != 2 )
        return( NULL );
    cons = ins->operands[c];
    if( cons->n.class != N_CONSTANT )
        return( NULL );
    if( cons->c.const_type != CONS_ABSOLUTE )
        return( NULL );
    if( CFTest( cons->c.value ) != 0 )
        return( NULL );
    rel = ins->operands[r];
    if( rel->c.const_type == CONS_OFFSET && !AskSegIsNear( (segment_id)rel->c.lo.int_value ) )
        return( NULL );
    switch( ins->head.opcode ) {
    case OP_BIT_TEST_FALSE:
    case OP_CMP_EQUAL:
    case OP_CMP_LESS:
    case OP_CMP_LESS_EQUAL:
        truth = false;
        break;
    case OP_BIT_TEST_TRUE:
    case OP_CMP_GREATER:
    case OP_CMP_GREATER_EQUAL:
    case OP_CMP_NOT_EQUAL:
        truth = true;
        break;
    default:
        return( false );
    }
    if( !ActiveCompare( ins ) )
        return( NULL );
    if( c != 1 )
        truth = !truth;
    if( truth ) {
        _SetBlockIndex( ins, _TrueIndex(ins), _TrueIndex(ins) );
    } else {
        _SetBlockIndex( ins, _FalseIndex(ins), _FalseIndex(ins) );
    }
    return( KillCompare( ins, AllocIntConst( truth ? FETrue() : 0 ) ) );
}