Changeset 255 in dev for trunk/abdev/BasicCompiler64/CodeGenerator.cpp
- Timestamp:
- Aug 1, 2007, 3:37:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/CodeGenerator.cpp
r254 r255 1599 1599 } 1600 1600 } 1601 void CodeGenerator::op_sub_rsp(long num){ 1601 const PertialSchedule *CodeGenerator::op_sub_rsp( long num, bool isPertialSchedule ) 1602 { 1602 1603 //スタックポインタの減算(push方向) 1604 const PertialSchedule *pPertialSchedule = NULL; 1603 1605 1604 1606 //sub rsp,num 1605 if( 0xFFFFFF80&num){1607 if( (0xFFFFFF80&num) != 0 || isPertialSchedule ){ 1606 1608 pNativeCode->Put( (char)0x48 ); 1607 1609 pNativeCode->Put( (char)0x81 ); 1608 1610 pNativeCode->Put( (char)0xEC ); 1611 1612 if( isPertialSchedule ) 1613 { 1614 pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) ); 1615 pPertialSchedule = pertialSchedules.back(); 1616 } 1609 1617 pNativeCode->Put( num ); 1610 1618 } … … 1616 1624 pNativeCode->Put( (char)num ); 1617 1625 } 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; 1652 1628 } 1653 1629
Note:
See TracChangeset
for help on using the changeset viewer.