Changeset 36 in dev for BasicCompiler32/NumOpe_Logical.cpp


Ignore:
Timestamp:
Jan 20, 2007, 4:55:26 AM (17 years ago)
Author:
dai_9181
Message:

Boolean型に対応。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/NumOpe_Logical.cpp

    r3 r36  
    450450    }
    451451
    452     if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
     452    if( type[sp - 1] == DEF_BOOLEAN ){
     453        //pop eax
     454        op_pop( REG_EAX );
     455
     456        //cmp eax,0
     457        op_cmp_value(GetTypeSize(type[sp-1],-1),REG_EAX,0);
     458
     459        //setne al
     460        op_setne( REG_EAX );
     461
     462        //and eax,000000FFh
     463        op_and_RV(REG_EAX,(int)0xFF);
     464
     465        //neg
     466        op_neg( REG_EAX );
     467
     468        //sbb eax, eax
     469        op_sbb_RR( REG_EAX, REG_EAX );
     470
     471        //add eax, 1
     472        op_add_RV8( REG_EAX, 1 );
     473
     474        //push eax
     475        op_push( REG_EAX );
     476    }
     477    else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
    453478        ////////////////////
    454479        // 64ビット整数演算
Note: See TracChangeset for help on using the changeset viewer.