Changeset 62 in dev for BasicCompiler32/Compile_Set_Var.cpp
- Timestamp:
- Feb 22, 2007, 3:57:56 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Set_Var.cpp
r55 r62 121 121 obp+=sizeof(long); 122 122 } 123 } 124 else if( VarKind==VAR_REFGLOBAL ){ 125 SetError(300,NULL,cp); 123 126 } 124 127 else if(VarKind==VAR_LOCAL){ … … 278 281 obp+=sizeof(long); 279 282 } 283 } 284 else if( VarKind==VAR_REFGLOBAL ){ 285 SetError(300,NULL,cp); 280 286 } 281 287 else if(VarKind==VAR_LOCAL){ … … 430 436 } 431 437 } 438 else if(pRelative->dwKind==VAR_REFLOCAL){ 439 if(pRelative->bOffsetOffset){ 440 //add ecx,dword ptr[offset] 441 op_add_RM( sizeof(long), REG_ECX, REG_NON, (int)pRelative->offset, MOD_DISP32 ); 442 } 443 else{ 444 //mov ecx,dword ptr[offset] 445 op_mov_RM( sizeof(long), REG_ECX, REG_NON, (int)pRelative->offset, MOD_DISP32 ); 446 } 447 obp-=sizeof(long); 448 pobj_GlobalVarSchedule->add(); 449 obp+=sizeof(long); 450 451 //mov dword ptr[ecx],eax 452 OpBuffer[obp++]=(char)0x89; 453 OpBuffer[obp++]=(char)0x01; 454 455 //mov dword ptr[ecx+sizeof(long)],edx 456 OpBuffer[obp++]=(char)0x89; 457 OpBuffer[obp++]=(char)0x51; 458 OpBuffer[obp++]=(char)0x04; 459 } 432 460 else if(pRelative->dwKind==VAR_LOCAL){ 433 461 if(pRelative->bOffsetOffset){ … … 573 601 obp+=sizeof(long); 574 602 } 603 } 604 else if(VarKind==VAR_REFGLOBAL){ 605 if(bOffsetOffset){ 606 //add ecx,dword ptr[offset] 607 op_add_RM( sizeof(long), REG_ECX, REG_NON, (int)offset, MOD_DISP32 ); 608 } 609 else{ 610 //mov ecx,dword ptr[offset] 611 op_mov_RM( sizeof(long), REG_ECX, REG_NON, (int)offset, MOD_DISP32 ); 612 } 613 obp-=sizeof(long); 614 pobj_GlobalVarSchedule->add(); 615 obp+=sizeof(long); 616 617 //mov dword ptr[ecx],eax 618 OpBuffer[obp++]=(char)0x89; 619 OpBuffer[obp++]=(char)0x01; 575 620 } 576 621 else if(VarKind==VAR_LOCAL){ … … 665 710 } 666 711 } 712 else if(VarKind==VAR_REFGLOBAL){ 713 //mov eax,dword ptr[offset] 714 op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)offset, MOD_DISP32 ); 715 obp-=sizeof(long); 716 pobj_GlobalVarSchedule->add(); 717 obp+=sizeof(long); 718 719 if(bOffsetOffset){ 720 //add eax,ecx 721 OpBuffer[obp++]=(char)0x03; 722 OpBuffer[obp++]=(char)0xC1; 723 } 724 725 //fistp dword ptr[eax] 726 fpu_cast(); 727 OpBuffer[obp++]=(char)0xDB; 728 OpBuffer[obp++]=(char)0x18; 729 fpu_cast_end(); 730 } 667 731 else if(VarKind==VAR_LOCAL){ 668 732 if(bOffsetOffset){ … … 751 815 } 752 816 } 817 else if(VarKind==VAR_REFGLOBAL){ 818 //mov ebx,dword ptr[offset] 819 op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)offset, MOD_DISP32 ); 820 obp-=sizeof(long); 821 pobj_GlobalVarSchedule->add(); 822 obp+=sizeof(long); 823 824 if(bOffsetOffset){ 825 //add ebx,ecx 826 OpBuffer[obp++]=(char)0x03; 827 OpBuffer[obp++]=(char)0xD9; 828 } 829 830 //mov word ptr[ebx],ax 831 OpBuffer[obp++]=(char)0x66; 832 OpBuffer[obp++]=(char)0x89; 833 OpBuffer[obp++]=(char)0x03; 834 } 753 835 else if(VarKind==VAR_LOCAL){ 754 836 if(bOffsetOffset){ … … 826 908 } 827 909 } 910 else if(VarKind==VAR_REFGLOBAL){ 911 //mov ebx,dword ptr[offset] 912 op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)offset, MOD_DISP32 ); 913 obp-=sizeof(long); 914 pobj_GlobalVarSchedule->add(); 915 obp+=sizeof(long); 916 917 if(bOffsetOffset){ 918 //add ebx,ecx 919 OpBuffer[obp++]=(char)0x03; 920 OpBuffer[obp++]=(char)0xD9; 921 } 922 923 //mov byte ptr[ebx],al 924 OpBuffer[obp++]=(char)0x88; 925 OpBuffer[obp++]=(char)0x03; 926 } 828 927 else if(VarKind==VAR_LOCAL){ 829 928 if(bOffsetOffset){
Note:
See TracChangeset
for help on using the changeset viewer.