Changeset 251 in dev for trunk/abdev/BasicCompiler32
- Timestamp:
- Jul 30, 2007, 2:00:45 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
r248 r251 244 244 extern HANDLE hHeap; 245 245 extern BOOL bDebugCompile; 246 int i3,i4,LocalVarSchedule, EspOffsetSchedule,BaseOffset;246 int i3,i4,LocalVarSchedule,BaseOffset; 247 247 char temporary[VN_SIZE]; 248 248 … … 440 440 compiler.codeGenerator.ClearContinueArea(); 441 441 442 const PertialSchedule *pEspOffsetPertialSchedule = NULL; 442 443 if(bDebugCompile&&bDebugSupportProc==0){ 443 444 //push dword ptr[ebp+(AllLocalVarSize-BaseOffset)](スケジュール) 444 OpBuffer[obp++]=(char)0xFF; 445 OpBuffer[obp++]=(char)0xB5; 446 EspOffsetSchedule=obp; 447 obp+=sizeof(long); 445 pEspOffsetPertialSchedule = compiler.codeGenerator.op_push_M( REG_EBP, 0, Schedule::None, true ); 448 446 449 447 //push dword ptr[ebp](以前のebp) … … 621 619 622 620 if(bDebugCompile&&bDebugSupportProc==0){ 623 *((long *)(OpBuffer+EspOffsetSchedule))=AllLocalVarSize-BaseOffset-sizeof(long);621 compiler.codeGenerator.opfix( pEspOffsetPertialSchedule, AllLocalVarSize-BaseOffset-sizeof(long) ); 624 622 625 623 //call _DebugSys_EndProc -
trunk/abdev/BasicCompiler32/x86CodeGenerator.cpp
r250 r251 19 19 #define INDEX_NON 0x04 20 20 21 void CodeGenerator::set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp, Schedule::Type scheduleType ){ 21 const PertialSchedule * CodeGenerator::set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp, Schedule::Type scheduleType, bool isPertialSchedule ) 22 { 23 const PertialSchedule *pPertialSchedule = NULL; 22 24 23 25 // エラーチェック … … 30 32 SetError(); 31 33 } 34 if( isPertialSchedule && !( mod == MOD_DISP32 || mod == MOD_BASE_DISP32 ) ) 35 { 36 SetError(); 37 } 32 38 33 39 if(mod==MOD_DISP32){ … … 45 51 46 52 //レジスタモードの場合は、ここで終了 47 if(mod==MOD_REG) return ;53 if(mod==MOD_REG) return pPertialSchedule; 48 54 49 55 … … 57 63 58 64 //ディスプレースメントを必要としない場合は、ここで終了 59 if(mod==MOD_BASE) return ;65 if(mod==MOD_BASE) return pPertialSchedule; 60 66 61 67 … … 70 76 else 71 77 { 78 if( isPertialSchedule ) 79 { 80 pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) ); 81 pPertialSchedule = pertialSchedules.back(); 82 } 83 72 84 pNativeCode->Put( disp, scheduleType ); 73 85 } 86 87 return pPertialSchedule; 74 88 } 75 89 … … 86 100 pNativeCode->Put( (char)(opcode|REGISTER_OPERAND(reg)) ); 87 101 } 88 void CodeGenerator::__op_format(char op_prefix,char opcode1,char opcode2,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){102 const PertialSchedule *CodeGenerator::__op_format(char op_prefix,char opcode1,char opcode2,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType, bool isPertialSchedule ){ 89 103 //命令プリフィックス 90 104 if(op_prefix) … … 101 115 102 116 //ModR/M, SIB, disp 103 set_mod_rm_sib_disp(mod,reg,SCALE_NON,INDEX_NON,base_reg,offset, scheduleType );117 return set_mod_rm_sib_disp(mod,reg,SCALE_NON,INDEX_NON,base_reg,offset, scheduleType, isPertialSchedule ); 104 118 } 105 119 … … 731 745 } 732 746 } 733 void CodeGenerator::op_push_M( int base_reg, long offset, Schedule::Type scheduleType ) 734 { 747 const PertialSchedule *CodeGenerator::op_push_M( int base_reg, long offset, Schedule::Type scheduleType, bool isPertialSchedule ) 748 { 749 const PertialSchedule *pPertialSchedule = NULL; 735 750 if( base_reg == REG_NON ) 736 751 { 737 752 // push dword ptr[offset] 738 __op_format( 0, (char)0xFF, 0, /*opcode->*/0x06, 0, offset, MOD_DISP32, scheduleType );753 pPertialSchedule = __op_format( 0, (char)0xFF, 0, /*opcode->*/0x06, 0, offset, MOD_DISP32, scheduleType, isPertialSchedule ); 739 754 } 740 755 else 741 756 { 742 757 // push dword ptr[base_reg+offset] 743 __op_format( 0, (char)0xFF, 0, /*opcode->*/0x06, base_reg, offset, MOD_BASE_DISP32, scheduleType ); 744 } 758 pPertialSchedule = __op_format( 0, (char)0xFF, 0, /*opcode->*/0x06, base_reg, offset, MOD_BASE_DISP32, scheduleType, isPertialSchedule ); 759 } 760 return pPertialSchedule; 745 761 } 746 762 void CodeGenerator::op_pop(int reg){
Note:
See TracChangeset
for help on using the changeset viewer.