Changeset 86 in dev
- Timestamp:
- Mar 30, 2007, 5:12:12 AM (18 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_ProcOp.cpp
r85 r86 3 3 4 4 5 void SystemProc( const char *name){6 if( lstrcmp(name,"_System_GetEip")==0){5 void SystemProc( const UserProc &userProc ){ 6 if( userProc.GetName() == "_System_GetEip" ){ 7 7 //mov eax,dword ptr[esp] 8 8 OpBuffer[obp++]=(char)0x8B; … … 13 13 OpBuffer[obp++]=(char)0xC3; 14 14 } 15 else if( lstrcmp(name,"_System_InitDllGlobalVariables")==0){15 else if( userProc.GetName() == "_System_InitDllGlobalVariables" ){ 16 16 //////////////////////////////////////// 17 17 // DLLのグローバル領域をコンパイル … … 54 54 OpBuffer[obp++]=(char)0xC3; 55 55 } 56 else if( lstrcmp(name,"_System_InitStaticLocalVariables")==0){56 else if( userProc.GetName() == "_System_InitStaticLocalVariables" ){ 57 57 //静的ローカルオブジェクトのコンストラクタ呼び出し 58 58 … … 77 77 OpBuffer[obp++]=(char)0xC3; 78 78 } 79 else if( lstrcmp(name,"_System_Call_Destructor_of_GlobalObject")==0){79 else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){ 80 80 81 81 UserProc *pBackUserProc; … … 91 91 OpBuffer[obp++]=(char)0xC3; 92 92 } 93 else if( lstrcmp(name,"_System_GetSp")==0){93 else if( userProc.GetName() == "_System_GetSp" ){ 94 94 //mov eax,esp 95 95 op_mov_RR(REG_EAX,REG_ESP); … … 101 101 OpBuffer[obp++]=(char)0xC3; 102 102 } 103 else if( lstrcmp(name,"_allrem")==0){103 else if( userProc.GetName() == "_allrem" ){ 104 104 //乗除演算用の特殊関数(64ビット整数対応) 105 105 BYTE Buffer_allrem[]={ … … 110 110 obp+=178; 111 111 } 112 else if( lstrcmp(name,"_aullrem")==0){112 else if( userProc.GetName() == "_aullrem" ){ 113 113 //乗除演算用の特殊関数(64ビット整数対応) 114 114 BYTE Buffer_aullrem[]={ … … 127 127 obp+=117; 128 128 } 129 else if( lstrcmp(name,"_allmul")==0){129 else if( userProc.GetName() == "_allmul" ){ 130 130 //乗算用の特殊関数(64ビット整数対応) 131 131 BYTE Buffer_allmul[]={ … … 136 136 obp+=52; 137 137 } 138 else if( lstrcmp(name,"_alldiv")==0){138 else if( userProc.GetName() == "_alldiv" ){ 139 139 //除算用の特殊関数(64ビット整数対応) 140 140 BYTE Buffer_alldiv[]={ … … 145 145 obp+=170; 146 146 } 147 else if( lstrcmp(name,"_aulldiv")==0){147 else if( userProc.GetName() == "_aulldiv" ){ 148 148 //整数除算用の特殊関数(64ビット整数対応) 149 149 BYTE Buffer_aulldiv[]={ … … 161 161 obp+=104; 162 162 } 163 else if( lstrcmp(name,"_allshl")==0){163 else if( userProc.GetName() == "_allshl" ){ 164 164 //符号あり左ビットシフト用の特殊関数(64ビット整数対応) 165 165 BYTE Buffer_allshl[]={ … … 170 170 obp+=31; 171 171 } 172 else if( lstrcmp(name,"_allshr")==0){172 else if( userProc.GetName() == "_allshr" ){ 173 173 //符号あり右ビットシフト用の特殊関数(64ビット整数対応) 174 174 BYTE Buffer_allshr[]={ … … 179 179 obp+=33; 180 180 } 181 else if( lstrcmp(name,"_aullshr")==0){181 else if( userProc.GetName() == "_aullshr" ){ 182 182 //符号なし右ビットシフト用の特殊関数(64ビット整数対応) 183 183 BYTE Buffer_aullshr[]={ … … 204 204 obp+=31; 205 205 } 206 else if( userProc.GetName() == "InitializeUserTypes" ){ 207 } 206 208 else{ 207 209 SetError(); … … 245 247 AllLocalVarSize=0; 246 248 247 SystemProc( pUserProc->GetName().c_str());249 SystemProc(*pUserProc); 248 250 249 251 pUserProc->endOpAddress=obp; -
BasicCompiler32/MakePeHdr.cpp
r78 r86 26 26 *pSub_System_GC_malloc_ForObjectPtr, 27 27 *pSub_System_GC_free_for_SweepingDelete, 28 *pSubStaticMethod_System_TypeBase_InitializeUserTypes, 28 29 29 30 *pSub_allrem, … … 245 246 if( pSub_System_GC_free_for_SweepingDelete = GetSubHash( "_System_GC_free_for_SweepingDelete",1 ) ) 246 247 pSub_System_GC_free_for_SweepingDelete->Using(); 248 249 if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "_System_TypeBase.InitializeUserTypes",1 ) ){ 250 pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using(); 251 pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsSystemProc(); 252 } 247 253 248 254 pSub_allrem=GetSubHash("_allrem"); -
BasicCompiler64/Compile_ProcOp.cpp
r85 r86 2 2 #include "Opcode.h" 3 3 4 void SystemProc( const char *name){5 if( lstrcmp(name,"_System_GetEip")==0){4 void SystemProc( const UserProc &userProc ){ 5 if( userProc.GetName() == "_System_GetEip" ){ 6 6 //mov rax,qword ptr[rsp] 7 7 op_mov_RM(sizeof(_int64),REG_RAX,REG_RSP,0,MOD_BASE); … … 10 10 OpBuffer[obp++]=(char)0xC3; 11 11 } 12 else if( lstrcmp(name,"_System_InitDllGlobalVariables")==0){12 else if( userProc.GetName() == "_System_InitDllGlobalVariables" ){ 13 13 //////////////////////////////////////// 14 14 // DLLのグローバル領域をコンパイル … … 61 61 OpBuffer[obp++]=(char)0xC3; 62 62 } 63 else if( lstrcmp(name,"_System_InitStaticLocalVariables")==0){63 else if( userProc.GetName() == "_System_InitStaticLocalVariables" ){ 64 64 //静的ローカルオブジェクトのコンストラクタ呼び出し 65 65 … … 95 95 OpBuffer[obp++]=(char)0xC3; 96 96 } 97 else if( lstrcmp(name,"_System_Call_Destructor_of_GlobalObject")==0){97 else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){ 98 98 //sub rsp,8(※RSPを16バイト境界にあわせるため) 99 99 op_sub_rsp(0x8); … … 115 115 OpBuffer[obp++]=(char)0xC3; 116 116 } 117 else if( lstrcmp(name,"_System_GetSp")==0){117 else if( userProc.GetName() == "_System_GetSp" ){ 118 118 //mov rax,rsp 119 119 op_mov_RR(REG_RAX,REG_RSP); … … 125 125 OpBuffer[obp++]=(char)0xC3; 126 126 } 127 else if( lstrcmp(name,"_allrem")==0){127 else if( userProc.GetName() == "_allrem" ){ 128 128 //乗除演算用の特殊関数(64ビット整数対応) 129 129 BYTE Buffer_allrem[]={ … … 134 134 obp+=178; 135 135 } 136 else if( lstrcmp(name,"_allmul")==0){136 else if( userProc.GetName() == "_allmul" ){ 137 137 //乗算用の特殊関数(64ビット整数対応) 138 138 BYTE Buffer_allmul[]={ … … 143 143 obp+=52; 144 144 } 145 else if( lstrcmp(name,"_alldiv")==0){145 else if( userProc.GetName() == "_alldiv" ){ 146 146 //除算用の特殊関数(64ビット整数対応) 147 147 BYTE Buffer_alldiv[]={ … … 152 152 obp+=170; 153 153 } 154 else if( lstrcmp(name,"_allshl")==0){154 else if( userProc.GetName() == "_allshl" ){ 155 155 //符号あり左ビットシフト用の特殊関数(64ビット整数対応) 156 156 BYTE Buffer_allshl[]={ … … 161 161 obp+=31; 162 162 } 163 else if( lstrcmp(name,"_allshr")==0){163 else if( userProc.GetName() == "_allshr" ){ 164 164 //符号あり右ビットシフト用の特殊関数(64ビット整数対応) 165 165 BYTE Buffer_allshr[]={ … … 170 170 obp+=33; 171 171 } 172 else if( lstrcmp(name,"_aullshr")==0){172 else if( userProc.GetName() == "_aullshr" ){ 173 173 //符号なし右ビットシフト用の特殊関数(64ビット整数対応) 174 174 BYTE Buffer_aullshr[]={ … … 195 195 obp+=31; 196 196 } 197 else if( userProc.GetName() == "InitializeUserTypes" ){ 198 } 199 else{ 200 SetError(); 201 } 197 202 } 198 203 void CompileBufferInProcedure(UserProc *pUserProc){ … … 240 245 pobj_sf=new CStackFrame(); 241 246 242 SystemProc( pUserProc->GetName().c_str());247 SystemProc(*pUserProc); 243 248 244 249 //スタックフレーム管理用オブジェクトを破棄 -
BasicCompiler64/MakePeHdr.cpp
r78 r86 22 22 *pSub_System_GC_malloc_ForObject, 23 23 *pSub_System_GC_malloc_ForObjectPtr, 24 *pSub_System_GC_free_for_SweepingDelete; 24 *pSub_System_GC_free_for_SweepingDelete, 25 *pSubStaticMethod_System_TypeBase_InitializeUserTypes; 25 26 26 27 … … 226 227 if( pSub_System_GC_free_for_SweepingDelete = GetSubHash( "_System_GC_free_for_SweepingDelete",1 ) ) 227 228 pSub_System_GC_free_for_SweepingDelete->Using(); 229 230 if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "_System_TypeBase.InitializeUserTypes",1 ) ){ 231 pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using(); 232 pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsSystemProc(); 233 } 228 234 229 235
Note:
See TracChangeset
for help on using the changeset viewer.