diff --git a/oscar64/InterCodeGenerator.cpp b/oscar64/InterCodeGenerator.cpp index 7b16b6f..e611c83 100644 --- a/oscar64/InterCodeGenerator.cpp +++ b/oscar64/InterCodeGenerator.cpp @@ -2910,7 +2910,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration* ptype->mSize = 2; ptype->mStride = vl.mType->mStride; vl.mReference = 0; - vl.mType = exp->mDecType; // ptype; + vl.mType = ptype; } if (vr.mType->mType == DT_TYPE_POINTER) @@ -2972,7 +2972,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration* ins->mDst.mTemp = proc->AddTemporary(ins->mDst.mType); block->Append(ins); } - else if (vr.mType->mType == DT_TYPE_POINTER && vr.mType->mBase->IsConstSame(vl.mType->mBase)) + else if ((vr.mType->mType == DT_TYPE_POINTER || vr.mType->mType == DT_TYPE_ARRAY) && (vl.mType->mType == DT_TYPE_POINTER || vl.mType->mType == DT_TYPE_ARRAY) && vr.mType->mBase->IsConstSame(vl.mType->mBase)) { if (exp->mToken == TK_SUB) { @@ -3035,6 +3035,8 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration* } else mErrors->Error(exp->mLocation, EERR_INCOMPATIBLE_OPERATOR, "Invalid pointer operation"); + + vl.mType = exp->mDecType; } else if (vr.mType->mType == DT_TYPE_POINTER || vr.mType->mType == DT_TYPE_ARRAY) { diff --git a/oscar64/NativeCodeGenerator.cpp b/oscar64/NativeCodeGenerator.cpp index 8a65c6a..02d91ab 100644 --- a/oscar64/NativeCodeGenerator.cpp +++ b/oscar64/NativeCodeGenerator.cpp @@ -34496,7 +34496,10 @@ bool NativeCodeBasicBlock::Propagate16BitSum(const ExpandingArraymType = ASMIT_ADC; + if (info.mSrcL->mType == ASMIT_LDA) + info.mAddL->mType = ASMIT_ADC; + else + info.mSrcL->mType = ASMIT_ADC; info.mAddL->mAddress = info.mAddress & 0xff; info.mAddH->mAddress = info.mAddress >> 8; info.mSrcL->mAddress = mRSumInfos[j].mSrcL->mAddress; @@ -34507,7 +34510,10 @@ bool NativeCodeBasicBlock::Propagate16BitSum(const ExpandingArraymType = ASMIT_ADC; + if (info.mSrcL->mType == ASMIT_LDA) + info.mAddL->mType = ASMIT_ADC; + else + info.mSrcL->mType = ASMIT_ADC; info.mAddL->mAddress = info.mAddress; info.mAddH->mAddress = info.mAddress; info.mSrcL->mAddress = mRSumInfos[j].mSrcL->mAddress; @@ -34519,7 +34525,10 @@ bool NativeCodeBasicBlock::Propagate16BitSum(const ExpandingArraymType = ASMIT_ADC; + if (info.mSrcL->mType == ASMIT_LDA) + info.mAddL->mType = ASMIT_ADC; + else + info.mSrcL->mType = ASMIT_ADC; info.mAddL->mAddress = info.mAddress; info.mAddL->mLinkerObject = info.mLinkerObject; info.mAddL->mMode = ASMIM_IMMEDIATE_ADDRESS; @@ -54464,7 +54473,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc) mInterProc->mLinkerObject->mNativeProc = this; - CheckFunc = !strcmp(mIdent->mString, "midc"); + CheckFunc = !strcmp(mIdent->mString, "main"); int nblocks = proc->mBlocks.Size(); tblocks = new NativeCodeBasicBlock * [nblocks];