Changeset 55 in dev for BasicCompiler32
- Timestamp:
- Feb 13, 2007, 3:14:57 AM (18 years ago)
- Location:
- BasicCompiler32
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/CParameter.cpp
r51 r55 334 334 ParmSize+=sizeof(long); 335 335 } 336 else if(DummyTypeInfo.type==DEF_INTEGER||DummyTypeInfo.type==DEF_WORD ){336 else if(DummyTypeInfo.type==DEF_INTEGER||DummyTypeInfo.type==DEF_WORD || (isUnicode&&DummyTypeInfo.type==DEF_CHAR)){ 337 337 ChangeTypeToInteger(CalcType); 338 338 ParmSize+=sizeof(long); 339 339 } 340 else if(DummyTypeInfo.type==DEF_ CHAR||DummyTypeInfo.type==DEF_BYTE||DummyTypeInfo.type==DEF_BOOLEAN){340 else if(DummyTypeInfo.type==DEF_SBYTE||DummyTypeInfo.type==DEF_BYTE||DummyTypeInfo.type==DEF_BOOLEAN || (isUnicode==false&&DummyTypeInfo.type==DEF_CHAR)){ 341 341 ChangeTypeToByte(CalcType); 342 342 ParmSize+=sizeof(long); -
BasicCompiler32/Compile_Calc.cpp
r46 r55 78 78 //符号あり 79 79 80 if(OldType==DEF_INTEGER ){80 if(OldType==DEF_INTEGER || (isUnicode&&OldType==DEF_CHAR)){ 81 81 //pop eax 82 82 op_pop(REG_EAX); … … 90 90 op_push(REG_EAX); 91 91 } 92 else if(OldType==DEF_ CHAR){92 else if(OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)){ 93 93 //pop eax 94 94 op_pop(REG_EAX); … … 170 170 //符号あり 171 171 172 if(OldType==DEF_INTEGER ){172 if(OldType==DEF_INTEGER || (isUnicode&&OldType==DEF_CHAR)){ 173 173 //pop eax 174 174 op_pop(REG_EAX); … … 182 182 op_push(REG_EAX); 183 183 } 184 else if(OldType==DEF_ CHAR){184 else if(OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)){ 185 185 //pop eax 186 186 op_pop(REG_EAX); … … 320 320 if(OldType==DEF_BOOLEAN|| 321 321 OldType==DEF_BYTE|| 322 OldType==DEF_WORD||OldType==DEF_INTEGER ) return;323 else if(OldType==DEF_ CHAR){322 OldType==DEF_WORD||OldType==DEF_INTEGER || (isUnicode&&OldType==DEF_CHAR)) return; 323 else if(OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)){ 324 324 //pop eax 325 325 op_pop(REG_EAX); … … 350 350 void ChangeTypeToByte(int OldType){ 351 351 //現在のスタックの内容をbyte型に変換する 352 if(OldType==DEF_BYTE||OldType==DEF_ CHAR) return;352 if(OldType==DEF_BYTE||OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)) return; 353 353 354 354 ChangeTypeToLong(OldType); … … 572 572 SetBooleanVariable(CalcType,&VarRelativeVar); 573 573 } 574 else if(VarType==DEF_ CHAR||VarType==DEF_BYTE){574 else if(VarType==DEF_SBYTE||VarType==DEF_BYTE || (isUnicode==false&&VarType==DEF_CHAR)){ 575 575 //8ビット整数型変数へスタックの内容を格納する 576 576 Set8Variable(CalcType,VarRelativeVar.dwKind,VarRelativeVar.offset,VarRelativeVar.bOffsetOffset); 577 577 } 578 else if(VarType==DEF_INTEGER||VarType==DEF_WORD ){578 else if(VarType==DEF_INTEGER||VarType==DEF_WORD || (isUnicode&&VarType==DEF_CHAR)){ 579 579 //16ビット整数型変数へスタックの内容を格納する 580 580 Set16Variable(CalcType,VarRelativeVar.dwKind,VarRelativeVar.offset,VarRelativeVar.bOffsetOffset); … … 687 687 SetBooleanVariable(CalcType,&VarRelativeVar); 688 688 } 689 else if(VarType==DEF_ CHAR||VarType==DEF_BYTE){689 else if(VarType==DEF_SBYTE||VarType==DEF_BYTE || (isUnicode==false&&VarType==DEF_CHAR)){ 690 690 //8ビット整数型変数へスタックの内容を格納する 691 691 Set8Variable(CalcType,VarRelativeVar.dwKind,VarRelativeVar.offset,VarRelativeVar.bOffsetOffset); 692 692 } 693 else if(VarType==DEF_INTEGER||VarType==DEF_WORD ){693 else if(VarType==DEF_INTEGER||VarType==DEF_WORD || (isUnicode&&VarType==DEF_CHAR)){ 694 694 //16ビット整数型変数へスタックの内容を格納する 695 695 Set16Variable(CalcType,VarRelativeVar.dwKind,VarRelativeVar.offset,VarRelativeVar.bOffsetOffset); -
BasicCompiler32/Compile_ProcOp.cpp
r51 r55 774 774 obp+=sizeof(long); 775 775 } 776 else if(i3==DEF_INTEGER||i3==DEF_WORD ){776 else if(i3==DEF_INTEGER||i3==DEF_WORD || (isUnicode&&i3==DEF_CHAR)){ 777 777 //xor eax,eax(eaxを0に初期化する) 778 778 op_zero_reg(REG_EAX); … … 786 786 obp+=sizeof(long); 787 787 } 788 else if(i3==DEF_ CHAR||i3==DEF_BYTE||i3==DEF_BOOLEAN){788 else if(i3==DEF_SBYTE||i3==DEF_BYTE||i3==DEF_BOOLEAN || (isUnicode==false&&i3==DEF_CHAR)){ 789 789 //xor eax,eax(eaxを0に初期化する) 790 790 op_zero_reg(REG_EAX); -
BasicCompiler32/Compile_Set_Var.cpp
r36 r55 804 804 } 805 805 void Set8Variable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset){ 806 ChangeTypeToWhole(type,DEF_ CHAR);806 ChangeTypeToWhole(type,DEF_SBYTE); 807 807 808 808 //pop eax -
BasicCompiler32/Compile_Statement.cpp
r51 r55 990 990 if(type1==DEF_INTEGER|| 991 991 type1==DEF_WORD|| 992 type1==DEF_ CHAR||992 type1==DEF_SBYTE|| 993 993 type1==DEF_BYTE|| 994 type1==DEF_BOOLEAN) CaseTypeSize=sizeof(long); 994 type1==DEF_BOOLEAN|| 995 type1==DEF_CHAR) CaseTypeSize=sizeof(long); 995 996 else{ 996 997 CaseTypeSize=GetTypeSize(type1,lpIndex); -
BasicCompiler32/Compile_Var.cpp
r50 r55 872 872 } 873 873 } 874 else if(type==DEF_INTEGER||type==DEF_WORD )874 else if(type==DEF_INTEGER||type==DEF_WORD || (isUnicode&&type==DEF_CHAR)) 875 875 *(WORD *)(initGlobalBuf+offset)=(WORD)i64data; 876 else if(type==DEF_ CHAR||type==DEF_BYTE||type==DEF_BOOLEAN)876 else if(type==DEF_SBYTE||type==DEF_BYTE||type==DEF_BOOLEAN || (isUnicode==false&&type==DEF_CHAR)) 877 877 *(BYTE *)(initGlobalBuf+offset)=(BYTE)i64data; 878 878 //String型が未完成 … … 1066 1066 obp+=sizeof(long); 1067 1067 } 1068 else if(type==DEF_INTEGER||type==DEF_WORD ){1068 else if(type==DEF_INTEGER||type==DEF_WORD || (isUnicode&&type==DEF_CHAR)){ 1069 1069 //mov ax,InitValue 1070 1070 OpBuffer[obp++]=(char)0x66; … … 1081 1081 obp+=sizeof(long); 1082 1082 } 1083 else if(type==DEF_ CHAR||type==DEF_BYTE||type==DEF_BOOLEAN){1083 else if(type==DEF_SBYTE||type==DEF_BYTE||type==DEF_BOOLEAN || (isUnicode==false&&type==DEF_CHAR)){ 1084 1084 //mov byte ptr[ebp+offset],InitValue 1085 1085 OpBuffer[obp++]=(char)0xC6; -
BasicCompiler32/NumOpe.cpp
r51 r55 39 39 op_push(REG_EAX); 40 40 } 41 else if(type==DEF_INTEGER ){41 else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){ 42 42 //movsx ebx,ax 43 43 OpBuffer[obp++]=(char)0x0F; … … 48 48 op_push(REG_EBX); 49 49 } 50 else if(type==DEF_ CHAR){50 else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){ 51 51 //movsx ebx,al 52 52 OpBuffer[obp++]=(char)0x0F; … … 418 418 PushLongVariable(&RelativeVar); 419 419 } 420 else if(i2==DEF_INTEGER ){420 else if(i2==DEF_INTEGER || (isUnicode&&i2==DEF_CHAR)){ 421 421 PushIntegerVariable(&RelativeVar); 422 422 } … … 424 424 PushWordVariable(&RelativeVar); 425 425 } 426 else if(i2==DEF_ CHAR){426 else if(i2==DEF_SBYTE || (isUnicode==false&&i2==DEF_CHAR)){ 427 427 PushCharVariable(&RelativeVar); 428 428 } … … 739 739 i3=(long)i64data; 740 740 741 if(i2==DEF_ CHAR||i2==DEF_BYTE||i2==DEF_BOOLEAN) i3=i3&0x000000FF;742 if(i2==DEF_INTEGER||i2==DEF_WORD ) i3=i3&0x0000FFFF;741 if(i2==DEF_SBYTE||i2==DEF_BYTE||i2==DEF_BOOLEAN || (isUnicode==false&&i2==DEF_CHAR)) i3=i3&0x000000FF; 742 if(i2==DEF_INTEGER||i2==DEF_WORD || (isUnicode&&i2==DEF_CHAR)) i3=i3&0x0000FFFF; 743 743 744 744 //push term -
BasicCompiler32/NumOpe_TypeOperation.cpp
r36 r55 51 51 op_push(REG_EAX); 52 52 } 53 else if(type==DEF_INTEGER ){53 else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){ 54 54 //pop eax 55 55 op_pop(REG_EAX); … … 75 75 op_push(REG_EAX); 76 76 } 77 else if(type==DEF_ CHAR){77 else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){ 78 78 //pop eax 79 79 op_pop(REG_EAX); … … 101 101 } 102 102 void ExtendStackTo16(int type){ 103 if(type==DEF_ CHAR){103 if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){ 104 104 //pop eax 105 105 op_pop(REG_EAX); -
BasicCompiler32/VarList.cpp
r36 r55 103 103 else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS); 104 104 } 105 else if(type==DEF_INTEGER ){105 else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){ 106 106 if(ReadProcessMemory(hDebugProcess,(void *)offset,&wData,sizeof(WORD),&dwAccessByte)){ 107 107 sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,(short)wData,(short)wData); … … 115 115 else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS); 116 116 } 117 else if(type==DEF_ CHAR){117 else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){ 118 118 if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&dwAccessByte)){ 119 119 temporary[0]=byteData; -
BasicCompiler32/increment.cpp
r36 r55 80 80 } 81 81 void ExtendTypeTo32(int type,int reg){ 82 if(type==DEF_INTEGER ){82 if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){ 83 83 //movsx reg32,reg16 84 84 op_movsx_R32R16(reg,reg); … … 88 88 op_and_RV(reg,(int)0x0000FFFF); 89 89 } 90 else if(type==DEF_ CHAR){90 else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){ 91 91 //movsx reg32,reg8 92 92 op_movsx_R32R8(reg,reg); … … 98 98 } 99 99 void ExtendTypeTo16(int type,int reg){ 100 if(type==DEF_ CHAR){100 if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){ 101 101 //movsx reg16,reg8 102 102 op_movsx_R16R8(reg,reg);
Note:
See TracChangeset
for help on using the changeset viewer.