Index: trunk/abdev/BasicCompiler64/Compile_Var.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Var.cpp	(revision 228)
+++ trunk/abdev/BasicCompiler64/Compile_Var.cpp	(revision 232)
@@ -868,8 +868,5 @@
 
 			//mov qword ptr[offset],rax
-			compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32);
-			obp-=sizeof(long);
-			pobj_GlobalVarSchedule->add();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32, Schedule::GlobalVar );
 		}
 		else{
@@ -992,5 +989,5 @@
 
 		//mov rax,i64data
-		compiler.codeGenerator.op_mov64_ToReg(REG_RAX,i64data);
+		compiler.codeGenerator.op_mov_RV64(REG_RAX,i64data);
 
 		//mov qword ptr[rsp+offset],rax
@@ -1034,5 +1031,5 @@
 			if(i64data&0xFFFFFFFF00000000){
 				//mov rax,i64data
-				compiler.codeGenerator.op_mov64_ToReg(REG_RAX,i64data);
+				compiler.codeGenerator.op_mov_RV64(REG_RAX,i64data);
 
 				//mov qword ptr[rsp+offset],rax
@@ -1116,5 +1113,5 @@
 		//アラインメントを考慮
 		if( pVar->GetType().IsStruct() ){
-			int alignment = pVar->GetType().GetClass().iAlign;
+			int alignment = pVar->GetType().GetClass().GetFixedAlignment();
 
 			if( alignment ){
@@ -1222,10 +1219,5 @@
 		if(pRelativeVar->bOffsetOffset){
 			//add r11,offset
-			OpBuffer[obp++]=(char)0x49;
-			OpBuffer[obp++]=(char)0x81;
-			OpBuffer[obp++]=(char)0xC3;
-			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
-			pobj_GlobalVarSchedule->add();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::GlobalVar );
 
 			//mov reg,r11
@@ -1234,8 +1226,5 @@
 		else{
 			//mov reg,offset
-			compiler.codeGenerator.op_mov64_ToReg(reg,(long)pRelativeVar->offset);
-			obp-=sizeof(long);
-			pobj_GlobalVarSchedule->add();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_mov_RV( sizeof(_int64), reg, (long)pRelativeVar->offset, Schedule::GlobalVar );
 		}
 	}
@@ -1243,15 +1232,9 @@
 		if(pRelativeVar->bOffsetOffset){
 			//add r11,qword ptr[offset]
-			compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
-			obp-=sizeof(long);
-			pobj_GlobalVarSchedule->add();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar );
 		}
 		else{
 			//mov r11,qword ptr[offset]
-			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
-			obp-=sizeof(long);
-			pobj_GlobalVarSchedule->add();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32, Schedule::GlobalVar );
 		}
 
@@ -1261,10 +1244,5 @@
 		if(pRelativeVar->bOffsetOffset){
 			//add r11,offset
-			OpBuffer[obp++]=(char)0x49;
-			OpBuffer[obp++]=(char)0x81;
-			OpBuffer[obp++]=(char)0xC3;
-			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
-			AddLocalVarAddrSchedule();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::LocalVar );
 
 			//add r11,rsp
@@ -1279,8 +1257,5 @@
 
 			//add reg,offset
-			compiler.codeGenerator.op_add_RV(reg,(int)pRelativeVar->offset);
-			obp-=sizeof(long);
-			AddLocalVarAddrSchedule();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::LocalVar );
 		}
 	}
@@ -1288,18 +1263,9 @@
 		if(pRelativeVar->bOffsetOffset){
 			//add r11,qword ptr[rsp+offset]
-			OpBuffer[obp++]=(char)0x4C;
-			OpBuffer[obp++]=(char)0x03;
-			OpBuffer[obp++]=(char)0x9C;
-			OpBuffer[obp++]=(char)0x24;
-			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
-			AddLocalVarAddrSchedule();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_add_RM( REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar );
 		}
 		else{
 			//mov r11,qword ptr[rsp+offset]
-			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
-			obp-=sizeof(long);
-			AddLocalVarAddrSchedule();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar );
 		}
 
@@ -1331,8 +1297,5 @@
 			// ルートポインタを引き渡す
 			//mov rdx,offset
-			compiler.codeGenerator.op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress());
-			obp-=sizeof(long);
-			pobj_GlobalVarSchedule->add();
-			obp+=sizeof(long);
+			compiler.codeGenerator.op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress(), Schedule::GlobalVar );
 
 			// Thisポインタを引き渡す
