Index: trunk/abdev/BasicCompiler32/Compile_Statement.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 245)
+++ trunk/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 246)
@@ -300,6 +300,4 @@
 void OpcodeGoto(char *Parameter){
 	extern HANDLE hHeap;
-	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
-	extern int GotoLabelScheduleNum;
 	int i,LineNum;
 
@@ -307,16 +305,14 @@
 		i=GetLabelAddress(Parameter+1,0);
 
-		//jmp ...
-		OpBuffer[obp++]=(char)0xE9;
-		if(i==-1){
-			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
-			pGotoLabelSchedule[GotoLabelScheduleNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Parameter+1)+1);
-			lstrcpy(pGotoLabelSchedule[GotoLabelScheduleNum].pName,Parameter+1);
-			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
-			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
-			GotoLabelScheduleNum++;
-		}
-		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
-		obp+=sizeof(long);
+		if( i == -1 )
+		{
+			//jmp ...(schedule)
+			compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( (const std::string)(Parameter + 1), obp, cp ) );
+		}
+		else
+		{
+			//jmp ...
+			compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
+		}
 	}
 	else{
@@ -324,16 +320,14 @@
 		i=GetLabelAddress(0,LineNum);
 
-		//jmp ...
-		OpBuffer[obp++]=(char)0xE9;
-		if(i==-1){
-			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
-			pGotoLabelSchedule[GotoLabelScheduleNum].pName=0;
-			pGotoLabelSchedule[GotoLabelScheduleNum].line=LineNum;
-			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
-			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
-			GotoLabelScheduleNum++;
-		}
-		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
-		obp+=sizeof(long);
+		if( i == -1 )
+		{
+			//jmp ...(schedule)
+			compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( LineNum, obp, cp ) );
+		}
+		else
+		{
+			//jmp ...
+			compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
+		}
 	}
 }
@@ -1126,6 +1120,4 @@
 void OpcodeGosub(char *Parameter){
 	extern HANDLE hHeap;
-	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
-	extern int GotoLabelScheduleNum;
 	int i,LineNum;
 
@@ -1133,16 +1125,14 @@
 		i=GetLabelAddress(Parameter+1,0);
 
-		//call ...
-		OpBuffer[obp++]=(char)0xE8;
-		if(i==-1){
-			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
-			pGotoLabelSchedule[GotoLabelScheduleNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Parameter+1)+1);
-			lstrcpy(pGotoLabelSchedule[GotoLabelScheduleNum].pName,Parameter+1);
-			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
-			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
-			GotoLabelScheduleNum++;
-		}
-		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
-		obp+=sizeof(long);
+		if( i == -1 )
+		{
+			//jmp ...(schedule)
+			compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( (const std::string)(Parameter + 1), obp, cp ) );
+		}
+		else
+		{
+			//jmp ...
+			compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
+		}
 	}
 	else{
@@ -1150,16 +1140,14 @@
 		i=GetLabelAddress(0,LineNum);
 
-		//call ...
-		OpBuffer[obp++]=(char)0xE8;
-		if(i==-1){
-			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
-			pGotoLabelSchedule[GotoLabelScheduleNum].pName=0;
-			pGotoLabelSchedule[GotoLabelScheduleNum].line=LineNum;
-			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
-			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
-			GotoLabelScheduleNum++;
-		}
-		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
-		obp+=sizeof(long);
+		if( i == -1 )
+		{
+			//jmp ...(schedule)
+			compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( LineNum, obp, cp ) );
+		}
+		else
+		{
+			//jmp ...
+			compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
+		}
 	}
 }
