Changeset 62 in dev for BasicCompiler32/Compile_Var.cpp
- Timestamp:
- Feb 22, 2007, 3:57:56 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Var.cpp
r56 r62 614 614 pRelativeVar->offset=GlobalVar[i].offset; 615 615 pRelativeVar->bOffsetOffset=0; 616 pRelativeVar->dwKind=VAR_GLOBAL; 616 if(GlobalVar[i].fRef){ 617 // 参照型 618 pRelativeVar->dwKind = VAR_REFGLOBAL; 619 } 620 else pRelativeVar->dwKind=VAR_GLOBAL; 617 621 *pType=GlobalVar[i].type; 618 622 lpIndex=GlobalVar[i].u.index; … … 1180 1184 GetNowStaticVarFullName(VarName,temporary); 1181 1185 1182 AddGlobalVariable( temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);1186 AddGlobalVariable(isRef, temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags); 1183 1187 1184 1188 /* … … 1193 1197 ///////////////////////// 1194 1198 1195 AddGlobalVariable( VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);1199 AddGlobalVariable(isRef, VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags); 1196 1200 } 1197 1201 else{ … … 1365 1369 } 1366 1370 } 1371 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 1372 if(pRelativeVar->bOffsetOffset){ 1373 //mov eax,ecx 1374 OpBuffer[obp++]=(char)0x8B; 1375 OpBuffer[obp++]=(char)0xC1; 1376 1377 //add eax,dword ptr[offset] 1378 op_add_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 1379 } 1380 else{ 1381 //mov eax,dword ptr[offset] 1382 op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 1383 } 1384 obp-=sizeof(long); 1385 pobj_GlobalVarSchedule->add(); 1386 obp+=sizeof(long); 1387 } 1367 1388 else if(pRelativeVar->dwKind==VAR_LOCAL){ 1368 1389 if(pRelativeVar->bOffsetOffset){
Note:
See TracChangeset
for help on using the changeset viewer.