Index: trunk/abdev/BasicCompiler32/x86CodeGenerator.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/x86CodeGenerator.cpp	(revision 251)
+++ trunk/abdev/BasicCompiler32/x86CodeGenerator.cpp	(revision 253)
@@ -124,7 +124,8 @@
 ///////////////////
 
-void CodeGenerator::op_mov_MV( int op_size, int base_reg, long offset, Schedule::Type offsetScheduleType, long value, Schedule::Type valueScheduleType )
+const PertialSchedule *CodeGenerator::op_mov_MV( int op_size, int base_reg, long offset, Schedule::Type offsetScheduleType, bool isPertialSchedule, long value, Schedule::Type valueScheduleType )
 {
 	//mov ptr[base_reg+offset],value
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	if( op_size == sizeof(char) )
@@ -132,5 +133,12 @@
 		pNativeCode->Put( (char)0xC6 );
 		pNativeCode->Put( (char)(0x80|REGISTER_OPERAND(base_reg)) );
+
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, offsetScheduleType );
+
 		pNativeCode->Put( (char)value );
 	}
@@ -140,5 +148,12 @@
 		pNativeCode->Put( (char)0xC7 );
 		pNativeCode->Put( (char)(0x80|REGISTER_OPERAND(base_reg)) );
+
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, offsetScheduleType );
+
 		pNativeCode->Put( (short)value );
 	}
@@ -147,7 +162,16 @@
 		pNativeCode->Put( (char)0xC7 );
 		pNativeCode->Put( (char)(0x80|REGISTER_OPERAND(base_reg)) );
+
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, offsetScheduleType );
+
 		pNativeCode->Put( value, valueScheduleType );
 	}
+
+	return pPertialSchedule;
 }
 void CodeGenerator::op_mov_RV(int reg,long offset, Schedule::Type scheduleType ){
@@ -169,5 +193,5 @@
 	pNativeCode->Put( (char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2)) );
 }
-void CodeGenerator::op_mov_RM(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){
+const PertialSchedule *CodeGenerator::op_mov_RM(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//mov reg32,dword ptr[base_reg+offset]
 	//mov reg16,word ptr[base_reg+offset]
@@ -183,10 +207,11 @@
 	else opcode=(char)0x8B;
 
-	__op_format(op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType );
-}
-void CodeGenerator::op_mov_RM_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType ){
+	return __op_format(op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType, isPertialSchedule );
+}
+const PertialSchedule *CodeGenerator::op_mov_RM_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//mov reg32,dword ptr[base_reg1+base_reg2+offset]
 	//mov reg16,word ptr[base_reg1+base_reg2+offset]
 	//mov reg8,byte ptr[base_reg1+base_reg2+offset]
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	if(base_reg1==REG_ESP){
@@ -215,4 +240,9 @@
 
 		//オフセット値
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, scheduleType );
 	}
@@ -228,6 +258,7 @@
 		pNativeCode->Put( (char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2)) );
 	}
-}
-void CodeGenerator::op_mov_MR(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){
+	return pPertialSchedule;
+}
+const PertialSchedule *CodeGenerator::op_mov_MR(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//mov dword ptr[base_reg+offset],reg32
 	//mov word ptr[base_reg+offset],reg16
@@ -243,10 +274,11 @@
 	else opcode=(char)0x89;
 
-	__op_format(op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType );
-}
-void CodeGenerator::op_mov_MR_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType ){
+	return __op_format(op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType, isPertialSchedule );
+}
+const PertialSchedule *CodeGenerator::op_mov_MR_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//mov dword ptr[base_reg1+base_reg2+offset],reg32
 	//mov word ptr[base_reg1+base_reg2+offset],reg16
 	//mov byte ptr[base_reg1+base_reg2+offset],reg8
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	if(base_reg1==REG_ESP){
@@ -275,4 +307,9 @@
 
 		//オフセット値
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, scheduleType );
 	}
@@ -288,4 +325,5 @@
 		pNativeCode->Put( (char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2)) );
 	}
+	return pPertialSchedule;
 }
 
@@ -355,5 +393,5 @@
 //////////////////////////////////
 
-void CodeGenerator::op_lea_RM( int reg, int base_reg, long offset, char mod, Schedule::Type scheduleType )
+const PertialSchedule *CodeGenerator::op_lea_RM( int reg, int base_reg, long offset, char mod, Schedule::Type scheduleType, bool isPertialSchedule )
 {
 	//16ビット演算の命令プリフィックス
@@ -363,5 +401,5 @@
 	char opcode=(char)0x8D;
 
-	__op_format( op_prefix, opcode, 0, reg, base_reg, offset, mod, scheduleType );
+	return __op_format( op_prefix, opcode, 0, reg, base_reg, offset, mod, scheduleType, isPertialSchedule );
 }
 
@@ -408,7 +446,8 @@
 	pNativeCode->Put( cValue );
 }
-void CodeGenerator::op_add_RV( int reg, long offset, Schedule::Type scheduleType )
+const PertialSchedule *CodeGenerator::op_add_RV( int reg, long offset, Schedule::Type scheduleType, bool isPertialSchedule )
 {
 	// add reg,offset
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	if( reg == REG_EAX )
@@ -416,5 +455,4 @@
 		// eaxのみ特殊
 		pNativeCode->Put( (char)0x05 );
-		pNativeCode->Put( offset, scheduleType );
 	}
 	else
@@ -422,6 +460,15 @@
 		pNativeCode->Put( (char)0x81 );
 		pNativeCode->Put( (char)(0xC0|REGISTER_OPERAND(reg)) );
-		pNativeCode->Put( offset, scheduleType );
-	}
+	}
+
+	// オフセット値
+	if( isPertialSchedule )
+	{
+		pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+		pPertialSchedule = pertialSchedules.back();
+	}
+	pNativeCode->Put( offset, scheduleType );
+
+	return pPertialSchedule;
 }
 void CodeGenerator::op_add_RR( int reg1, int reg2 )
@@ -435,5 +482,5 @@
 	__op_format(op_prefix,opcode,0,reg1,reg2,0,MOD_REG);
 }
-void CodeGenerator::op_add_RM(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){
+const PertialSchedule *CodeGenerator::op_add_RM(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//add reg32,dword ptr[base_reg+offset]
 	//add reg16,word ptr[base_reg+offset]
@@ -449,5 +496,5 @@
 	else opcode=(char)0x03;
 
-	__op_format(op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType );
+	return __op_format(op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType, isPertialSchedule );
 }
 void CodeGenerator::op_adc_RV8(int reg,char cValue){
@@ -787,11 +834,18 @@
 	}
 }
-void CodeGenerator::op_sub_esp(long num){
+const PertialSchedule *CodeGenerator::op_sub_esp( long num, bool isPertialSchedule ){
 	//スタックポインタの減算（push方向）
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	//sub esp,num
-	if(0xFFFFFF80&num){
+	if( (0xFFFFFF80&num) != 0 || isPertialSchedule ){
 		pNativeCode->Put( (char)0x81 );
 		pNativeCode->Put( (char)0xEC );
+
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( num );
 	}
@@ -802,4 +856,6 @@
 		pNativeCode->Put( (char)num );
 	}
+
+	return pPertialSchedule;
 }
 
@@ -922,6 +978,7 @@
 	}
 }
-void CodeGenerator::op_fld_base_offset(int type,int base_reg,long offset, Schedule::Type scheduleType ){
+const PertialSchedule *CodeGenerator::op_fld_base_offset(int type,int base_reg,long offset, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//fld ptr[reg+offset]
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	//オペコード
@@ -940,8 +997,16 @@
 
 	//オフセット値
+	if( isPertialSchedule )
+	{
+		pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+		pPertialSchedule = pertialSchedules.back();
+	}
 	pNativeCode->Put( offset, scheduleType );
-}
-void CodeGenerator::op_fld_base_offset_ex(int type,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType ){
+
+	return pPertialSchedule;
+}
+const PertialSchedule *CodeGenerator::op_fld_base_offset_ex(int type,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//fld ptr[base_reg1+base_reg2+offset]
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	if(base_reg1==REG_ESP){
@@ -969,4 +1034,9 @@
 
 		//オフセット値
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, scheduleType );
 	}
@@ -982,4 +1052,6 @@
 		pNativeCode->Put( (char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2)) );
 	}
+
+	return pPertialSchedule;
 }
 void CodeGenerator::op_fstp_basereg(int type,int base_reg){
@@ -1003,6 +1075,7 @@
 	}
 }
-void CodeGenerator::op_fstp_base_offset(int type,int base_reg,long offset, Schedule::Type scheduleType ){
+const PertialSchedule *CodeGenerator::op_fstp_base_offset(int type,int base_reg,long offset, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//fstp ptr[reg+offset]
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	//オペコード
@@ -1021,8 +1094,16 @@
 
 	//オフセット値
+	if( isPertialSchedule )
+	{
+		pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+		pPertialSchedule = pertialSchedules.back();
+	}
 	pNativeCode->Put( offset, scheduleType );
-}
-void CodeGenerator::op_fstp_base_offset_ex(int type,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType ){
+
+	return pPertialSchedule;
+}
+const PertialSchedule *CodeGenerator::op_fstp_base_offset_ex(int type,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType, bool isPertialSchedule ){
 	//fstp ptr[base_reg1+base_reg2+offset]
+	const PertialSchedule *pPertialSchedule = NULL;
 
 	if(base_reg1==REG_ESP){
@@ -1050,4 +1131,9 @@
 
 		//オフセット値
+		if( isPertialSchedule )
+		{
+			pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
+			pPertialSchedule = pertialSchedules.back();
+		}
 		pNativeCode->Put( offset, scheduleType );
 	}
@@ -1063,4 +1149,6 @@
 		pNativeCode->Put( (char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2)) );
 	}
+
+	return pPertialSchedule;
 }
 void CodeGenerator::op_fistp_ptr_esp( int typeSize ){
