#include "stdafx.h" #include #ifdef _AMD64_ #include "../compiler_x64/opcode.h" #else #include "../compiler_x86/opcode.h" #endif using namespace ActiveBasic::Compiler; void InitGCVariables(void){ char temporary[255]; Type type; RELATIVE_VAR RelativeVar; /////////////////////////////// // スタックフレームの開始位置 /////////////////////////////// if( compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( "_System_gc_StackRoot_StartPtr" ) ) == NULL ) { // 未定義の場合は定義する sprintf(temporary,"_System_gc_StackRoot_StartPtr%c%c*LONG_PTR",1,ESC_AS); OpcodeDim(temporary,0); } GetVarOffsetReadWrite("_System_gc_StackRoot_StartPtr",&RelativeVar,type); //mov rax,rsp compiler.codeGenerator.op_mov_RR(REG_RAX,REG_RSP); //mov ptr[offset],rax/eax compiler.codeGenerator.op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32, Schedule::GlobalVar ); }