Index: trunk/abdev/BasicCompiler64/CodeGenerator.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/CodeGenerator.cpp	(revision 226)
+++ trunk/abdev/BasicCompiler64/CodeGenerator.cpp	(revision 228)
@@ -79,5 +79,5 @@
 #define INDEX_NON	0x04
 
-void CodeGenerator::set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp){
+void CodeGenerator::set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp, Schedule::Type scheduleType ){
 	if(mod==MOD_DISP32){
 		//ModR/Mバイト
@@ -115,11 +115,11 @@
 	if(mod==MOD_BASE_DISP8) pNativeCode->Put( (char)disp );
 	else{
-		pNativeCode->Put( disp );
-	}
-}
-
-
-
-void CodeGenerator::__op_format(int op_size,char op_prefix,char opcode1,char opcode2,int reg,int base_reg,long offset,char mod){
+		pNativeCode->Put( disp, scheduleType );
+	}
+}
+
+
+
+void CodeGenerator::__op_format(int op_size,char op_prefix,char opcode1,char opcode2,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType ){
 	//命令プリフィックス
 	if(op_prefix) pNativeCode->Put( op_prefix );
@@ -133,5 +133,23 @@
 
 	//ModR/M, SIB, disp
-	set_mod_rm_sib_disp(mod,reg,SCALE_NON,INDEX_NON,base_reg,offset);
+	set_mod_rm_sib_disp(mod,reg,SCALE_NON,INDEX_NON,base_reg,offset, scheduleType );
+}
+
+void CodeGenerator::__jmp_op_format( char opcode, long offset, int op_size )
+{
+	pNativeCode->Put( opcode );
+	if( op_size == sizeof(char) )
+	{
+		pNativeCode->Put( (char)offset );
+	}
+	else if( op_size == sizeof(long) )
+	{
+		SetError();
+		pNativeCode->Put( offset );
+	}
+	else
+	{
+		SetError();
+	}
 }
 
@@ -175,5 +193,5 @@
 	pNativeCode->Put( i64data );
 }
-void CodeGenerator::op_mov_RM(int op_size,int reg,int base_reg,long offset,char mod){
+void CodeGenerator::op_mov_RM(int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType ){
 	//mov reg64,qword ptr[base_reg+offset]
 	//mov reg32,dword ptr[base_reg+offset]
@@ -190,7 +208,7 @@
 	else opcode=(char)0x8B;
 
-	__op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod);
-}
-void CodeGenerator::op_mov_RM_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset){
+	__op_format(op_size,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 ){
 	//mov reg64,qword ptr[base_reg1+base_reg2+offset]
 	//mov reg32,dword ptr[base_reg1+base_reg2+offset]
@@ -226,5 +244,5 @@
 
 		//オフセット値
-		pNativeCode->Put( offset );
+		pNativeCode->Put( offset, scheduleType );
 	}
 	else{
@@ -561,4 +579,16 @@
 
 //////////////////////////////////
+// ビット拡張
+//////////////////////////////////
+
+void CodeGenerator::op_cqo()
+{
+	pNativeCode->Put( (char)0x48 );
+	pNativeCode->Put( (char)0x99 );
+}
+
+
+
+//////////////////////////////////
 // インクリメント・デクリメント
 //////////////////////////////////
@@ -593,5 +623,5 @@
 /////////////////////
 
-void CodeGenerator::op_add_RM(int op_size,int reg,int base_reg,int offset,char mod){
+void CodeGenerator::op_add_RM(int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){
 	//add reg64,qword ptr[base_reg+offset]
 	//add reg32,dword ptr[base_reg+offset]
@@ -608,5 +638,5 @@
 	else opcode=(char)0x03;
 
-	__op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod);
+	__op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType );
 }
 
@@ -638,5 +668,5 @@
 	}
 }
-void CodeGenerator::op_add64_reg(int reg1,int reg2){
+void CodeGenerator::op_add_RR(int reg1,int reg2){
 	//add reg1,reg2
 	char RexByte=-1;
@@ -1704,4 +1734,55 @@
 
 /////////////////////////////
+// 分岐
+/////////////////////////////
+
+void CodeGenerator::op_jle( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x7E, offset, op_size );
+}
+void CodeGenerator::op_jbe( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x76, offset, op_size );
+}
+void CodeGenerator::op_jge( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x7D, offset, op_size );
+}
+void CodeGenerator::op_jae( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x73, offset, op_size );
+}
+void CodeGenerator::op_jl( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x7C, offset, op_size );
+}
+void CodeGenerator::op_jb( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x72, offset, op_size );
+}
+void CodeGenerator::op_jg( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x7F, offset, op_size );
+}
+void CodeGenerator::op_ja( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x77, offset, op_size );
+}
+void CodeGenerator::op_jne( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x75, offset, op_size );
+}
+void CodeGenerator::op_je( long offset, int op_size )
+{
+	__jmp_op_format( (char)0x74, offset, op_size );
+}
+void CodeGenerator::op_jmp( long offset, int op_size )
+{
+	__jmp_op_format( (char)0xEB, offset, op_size );
+}
+
+
+
+/////////////////////////////
 // 関数呼び出し
 /////////////////////////////
