Changeset 62 in dev for BasicCompiler32/Compile_Calc_PushVar.cpp
- Timestamp:
- Feb 22, 2007, 3:57:56 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Calc_PushVar.cpp
r3 r62 21 21 op_fld_basereg(type,REG_ECX); 22 22 } 23 } 24 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 25 SetError(300,NULL,cp); 23 26 } 24 27 else if(pRelativeVar->dwKind==VAR_LOCAL){ … … 89 92 //mov reg, ptr[ecx+offset] 90 93 op_mov_RM(var_size,reg,REG_ECX,(int)pRelativeVar->offset,MOD_BASE_DISP32); 91 obp-=sizeof(long);92 pobj_GlobalVarSchedule->add();93 obp+=sizeof(long);94 94 } 95 95 else{ 96 96 //mov reg, ptr[offset] 97 97 op_mov_RM(var_size,reg,0,(int)pRelativeVar->offset,MOD_DISP32); 98 obp-=sizeof(long); 99 pobj_GlobalVarSchedule->add(); 100 obp+=sizeof(long); 101 } 98 } 99 obp-=sizeof(long); 100 pobj_GlobalVarSchedule->add(); 101 obp+=sizeof(long); 102 } 103 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 104 if(pRelativeVar->bOffsetOffset){ 105 //add ecx,qword ptr[offset] 106 op_add_RM(var_size,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 107 } 108 else{ 109 //mov ecx,qword ptr[offset] 110 op_mov_RM(var_size,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 111 } 112 obp-=sizeof(long); 113 pobj_GlobalVarSchedule->add(); 114 obp+=sizeof(long); 115 116 goto directmem; 102 117 } 103 118 else if(pRelativeVar->dwKind==VAR_LOCAL){ … … 105 120 //mov reg, ptr[ebp+ecx+offset] 106 121 op_mov_RM_ex(var_size,reg,REG_EBP,REG_ECX,(int)pRelativeVar->offset,USE_OFFSET); 107 obp-=sizeof(long);108 AddLocalVarAddrSchedule();109 obp+=sizeof(long);110 122 } 111 123 else{ 112 124 //mov reg, ptr[ebp+offset] 113 125 op_mov_RM(var_size,reg,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 114 obp-=sizeof(long);115 AddLocalVarAddrSchedule();116 obp+=sizeof(long);117 }126 } 127 obp-=sizeof(long); 128 AddLocalVarAddrSchedule(); 129 obp+=sizeof(long); 118 130 } 119 131 else if(pRelativeVar->dwKind==VAR_REFLOCAL){ … … 121 133 //add ecx,qword ptr[ebp+offset] 122 134 op_add_RM(var_size,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 123 obp-=sizeof(long);124 AddLocalVarAddrSchedule();125 obp+=sizeof(long);126 135 } 127 136 else{ 128 137 //mov ecx,qword ptr[ebp+offset] 129 138 op_mov_RM(var_size,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 130 obp-=sizeof(long);131 AddLocalVarAddrSchedule();132 obp+=sizeof(long);133 }139 } 140 obp-=sizeof(long); 141 AddLocalVarAddrSchedule(); 142 obp+=sizeof(long); 134 143 135 144 goto directmem; … … 178 187 obp+=sizeof(long); 179 188 } 189 } 190 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 191 SetError(300,NULL,cp); 180 192 } 181 193 else if(pRelativeVar->dwKind==VAR_LOCAL){ … … 275 287 } 276 288 } 289 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 290 //mov eax,dword ptr[offset] 291 op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 292 obp-=sizeof(long); 293 pobj_GlobalVarSchedule->add(); 294 obp+=sizeof(long); 295 296 if(pRelativeVar->bOffsetOffset){ 297 //add eax,ecx 298 OpBuffer[obp++]=(char)0x03; 299 OpBuffer[obp++]=(char)0xC1; 300 } 301 302 //push dword ptr[eax] 303 OpBuffer[obp++]=(char)0xFF; 304 OpBuffer[obp++]=(char)0x30; 305 } 277 306 else if(pRelativeVar->dwKind==VAR_LOCAL){ 278 307 if(pRelativeVar->bOffsetOffset){ … … 343 372 obp+=sizeof(long); 344 373 } 374 } 375 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 376 //mov ebx,dword ptr[offset] 377 op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 378 obp-=sizeof(long); 379 pobj_GlobalVarSchedule->add(); 380 obp+=sizeof(long); 381 382 if(pRelativeVar->bOffsetOffset){ 383 //add ebx,ecx 384 OpBuffer[obp++]=(char)0x03; 385 OpBuffer[obp++]=(char)0xD9; 386 } 387 388 //movsx eax,word ptr[ebx] 389 OpBuffer[obp++]=(char)0x0F; 390 OpBuffer[obp++]=(char)0xBF; 391 OpBuffer[obp++]=(char)0x03; 345 392 } 346 393 else if(pRelativeVar->dwKind==VAR_LOCAL){ … … 422 469 } 423 470 } 471 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 472 //mov ebx,dword ptr[offset] 473 op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 474 obp-=sizeof(long); 475 pobj_GlobalVarSchedule->add(); 476 obp+=sizeof(long); 477 478 if(pRelativeVar->bOffsetOffset){ 479 //add ebx,ecx 480 OpBuffer[obp++]=(char)0x03; 481 OpBuffer[obp++]=(char)0xD9; 482 } 483 484 //mov ax,word ptr[ebx] 485 OpBuffer[obp++]=(char)0x66; 486 OpBuffer[obp++]=(char)0x8B; 487 OpBuffer[obp++]=(char)0x03; 488 } 424 489 else if(pRelativeVar->dwKind==VAR_LOCAL){ 425 490 if(pRelativeVar->bOffsetOffset){ … … 498 563 } 499 564 } 565 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 566 //mov ebx,dword ptr[offset] 567 op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 568 obp-=sizeof(long); 569 pobj_GlobalVarSchedule->add(); 570 obp+=sizeof(long); 571 572 if(pRelativeVar->bOffsetOffset){ 573 //add ebx,ecx 574 OpBuffer[obp++]=(char)0x03; 575 OpBuffer[obp++]=(char)0xD9; 576 } 577 578 //movsx eax,byte ptr[ebx] 579 OpBuffer[obp++]=(char)0x0F; 580 OpBuffer[obp++]=(char)0xBE; 581 OpBuffer[obp++]=(char)0x03; 582 } 500 583 else if(pRelativeVar->dwKind==VAR_LOCAL){ 501 584 if(pRelativeVar->bOffsetOffset){ … … 574 657 } 575 658 } 659 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 660 //mov ebx,dword ptr[offset] 661 op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 662 obp-=sizeof(long); 663 pobj_GlobalVarSchedule->add(); 664 obp+=sizeof(long); 665 666 if(pRelativeVar->bOffsetOffset){ 667 //add ebx,ecx 668 OpBuffer[obp++]=(char)0x03; 669 OpBuffer[obp++]=(char)0xD9; 670 } 671 672 //mov al,byte ptr[ebx] 673 OpBuffer[obp++]=(char)0x8A; 674 OpBuffer[obp++]=(char)0x03; 675 } 576 676 else if(pRelativeVar->dwKind==VAR_LOCAL){ 577 677 if(pRelativeVar->bOffsetOffset){
Note:
See TracChangeset
for help on using the changeset viewer.