Index: trunk/abdev/BasicCompiler32/Compile_Object.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Object.cpp	(revision 225)
+++ trunk/abdev/BasicCompiler32/Compile_Object.cpp	(revision 235)
@@ -84,7 +84,5 @@
 
 		//add eax,TypeSize
-		OpBuffer[obp++]=(char)0x05;
-		*((long *)(OpBuffer+obp))=ObjectSize;
-		obp+=sizeof(long);
+		compiler.codeGenerator.op_add_RV( REG_EAX, ObjectSize );
 
 		//sub ebx,1
@@ -119,25 +117,17 @@
 
 		//※添え字上限値であることを考慮
-		//add eax,1
-		OpBuffer[obp++]=(char)0x83;
-		OpBuffer[obp++]=(char)0xC0;
-		OpBuffer[obp++]=(char)0x01;
+		//inc eax
+		compiler.codeGenerator.op_inc( REG_EAX );
 
 		//オブジェクトの個数をebxに一時保持
 		//※ebxは関数が呼ばれても不変
 		//mov ebx,eax
-		OpBuffer[obp++]=(char)0x8B;
-		OpBuffer[obp++]=(char)0xD8;
+		compiler.codeGenerator.op_mov_RR( REG_EBX, REG_EAX );
 
 		//imul eax,size
-		OpBuffer[obp++]=(char)0x69;
-		OpBuffer[obp++]=(char)0xC0;
-		*((long *)(OpBuffer+obp))=typeSize;
-		obp+=sizeof(long);
+		compiler.codeGenerator.op_imul_RV( REG_EAX, typeSize );
 
 		//add eax,OBJECT_HEAD_SIZE
-		OpBuffer[obp++]=(char)0x05;
-		*((long *)(OpBuffer+obp))=OBJECT_HEAD_SIZE;
-		obp+=sizeof(long);
+		compiler.codeGenerator.op_add_RV8( REG_EAX, (char)OBJECT_HEAD_SIZE );
 
 		//push eax
@@ -148,12 +138,8 @@
 		//※ebxは関数が呼ばれても不変
 		//mov ebx,1
-		OpBuffer[obp++]=(char)0xBB;
-		*((long *)(OpBuffer+obp))=1;
-		obp+=sizeof(long);
+		compiler.codeGenerator.op_mov_RV( REG_EBX, 1 );
 
 		//push size + OBJECT_HEAD_SIZE
-		OpBuffer[obp++]=(char)0x68;
-		*((long *)(OpBuffer+obp))=typeSize + OBJECT_HEAD_SIZE;
-		obp+=sizeof(long);
+		compiler.codeGenerator.op_push_V( typeSize + OBJECT_HEAD_SIZE );
 	}
 
@@ -188,22 +174,15 @@
 	compiler.codeGenerator.op_mov_MR( sizeof(long), REG_EBX, REG_EAX, 0, MOD_BASE );
 
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
-
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 	//mov ecx,TypeSize
-	OpBuffer[obp++]=(char)0xB9;
-	*((long *)(OpBuffer+obp))=typeSize;
-	obp+=sizeof(long);
+	compiler.codeGenerator.op_mov_RV( REG_ECX, typeSize );
 
 	//mov dword ptr[eax],ecx（オブジェクトのサイズ）
 	compiler.codeGenerator.op_mov_MR( sizeof(long), REG_ECX, REG_EAX, 0, MOD_BASE );
 
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
@@ -220,15 +199,11 @@
 	compiler.codeGenerator.op_mov_MR( sizeof(long), REG_ECX, REG_EAX, 0, MOD_BASE );
 
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
 	// リザーブ領域
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
@@ -264,43 +239,31 @@
 
 	//mov ebx,dword ptr[eax]（オブジェクトの個数）
-	OpBuffer[obp++]=(char)0x8B;
-	OpBuffer[obp++]=(char)0x18;
-
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EBX, REG_EAX, 0, MOD_BASE );
+
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
 	//mov esi,dword ptr[eax]（オブジェクトのサイズ）
-	OpBuffer[obp++]=(char)0x8B;
-	OpBuffer[obp++]=(char)0x30;
-
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	compiler.codeGenerator.op_mov_RM( sizeof(long), REG_ESI, REG_EAX, 0, MOD_BASE );
+
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
 	//mov edx,dword ptr[eax]（デストラクタの関数ポインタ）
-	OpBuffer[obp++]=(char)0x8B;
-	OpBuffer[obp++]=(char)0x10;
-
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EAX, 0, MOD_BASE );
+
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
 	// リザーブ領域
-	//add eax,sizeof(DWORD)
-	OpBuffer[obp++]=(char)0x05;
-	*((long *)(OpBuffer+obp))=sizeof(DWORD);
-	obp+=sizeof(long);
+	//add eax,sizeof(long)
+	compiler.codeGenerator.op_add_RV8( REG_EAX, sizeof(long) );
 
 
 	//mov ecx,eax
-	OpBuffer[obp++]=(char)0x8B;
-	OpBuffer[obp++]=(char)0xC8;
+	compiler.codeGenerator.op_mov_RR( REG_ECX, REG_EAX );
 
 
@@ -319,6 +282,5 @@
 
 	//call edx
-	OpBuffer[obp++]=(char)0xFF;
-	OpBuffer[obp++]=(char)0xD2;
+	compiler.codeGenerator.op_call_R( REG_EDX );
 
 	//pop edx
