Ignore:
Timestamp:
Aug 1, 2007, 3:37:09 AM (17 years ago)
Author:
dai_9181
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler64/CodeGenerator.cpp

    r254 r255  
    15991599    }
    16001600}
    1601 void CodeGenerator::op_sub_rsp(long num){
     1601const PertialSchedule *CodeGenerator::op_sub_rsp( long num, bool isPertialSchedule )
     1602{
    16021603    //スタックポインタの減算(push方向)
     1604    const PertialSchedule *pPertialSchedule = NULL;
    16031605
    16041606    //sub rsp,num
    1605     if(0xFFFFFF80&num){
     1607    if( (0xFFFFFF80&num) != 0 || isPertialSchedule ){
    16061608        pNativeCode->Put( (char)0x48 );
    16071609        pNativeCode->Put( (char)0x81 );
    16081610        pNativeCode->Put( (char)0xEC );
     1611
     1612        if( isPertialSchedule )
     1613        {
     1614            pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
     1615            pPertialSchedule = pertialSchedules.back();
     1616        }
    16091617        pNativeCode->Put( num );
    16101618    }
     
    16161624        pNativeCode->Put( (char)num );
    16171625    }
    1618 }
    1619 
    1620 
    1621 void CodeGenerator::op_add_esp(long num){
    1622     //スタックポインタの加算(pop方向)
    1623 
    1624     //add esp,num
    1625     if(0xFFFFFF80&num){
    1626         pNativeCode->Put( (char)0x81 );
    1627         pNativeCode->Put( (char)0xC4 );
    1628         pNativeCode->Put( num );
    1629     }
    1630     else{
    1631         //「-128 < num < 127」の場合
    1632         pNativeCode->Put( (char)0x83 );
    1633         pNativeCode->Put( (char)0xC4 );
    1634         pNativeCode->Put( (char)num );
    1635     }
    1636 }
    1637 void CodeGenerator::op_sub_esp(long num){
    1638     //スタックポインタの減算(push方向)
    1639 
    1640     //sub esp,num
    1641     if(0xFFFFFF80&num){
    1642         pNativeCode->Put( (char)0x81 );
    1643         pNativeCode->Put( (char)0xEC );
    1644         pNativeCode->Put( num );
    1645     }
    1646     else{
    1647         //「-128 < num < 127」の場合
    1648         pNativeCode->Put( (char)0x83 );
    1649         pNativeCode->Put( (char)0xEC );
    1650         pNativeCode->Put( (char)num );
    1651     }
     1626
     1627    return pPertialSchedule;
    16521628}
    16531629
Note: See TracChangeset for help on using the changeset viewer.