diff --git a/autotest/arraytest.c b/autotest/arraytest.c index 714e044..4b12596 100644 --- a/autotest/arraytest.c +++ b/autotest/arraytest.c @@ -45,12 +45,37 @@ void reverseb(int * d, const int * s, char n) d[i] = s[n - i - 1]; } +long suml(long * a, char s) +{ + long sum = 0; + for(char i=0; imAddress)); - mIns[apos].mLive = LIVE_CPU_REG_Y; + mIns[apos].mLive = LIVE_CPU_REG_Y | LIVE_MEM; } else { @@ -9825,6 +9886,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(int pass) else { mIns.Insert(i + 2, NativeCodeInstruction(ASMIT_LDY, ASMIM_ZERO_PAGE, ireg)); + mIns[i + 2].mLive = mIns[i + 3].mLive | LIVE_CPU_REG_Y | LIVE_MEM; mIns[i + 3].mAddress = breg; } progress = true; diff --git a/oscar64/NativeCodeGenerator.h b/oscar64/NativeCodeGenerator.h index c88a5c0..5b30b7c 100644 --- a/oscar64/NativeCodeGenerator.h +++ b/oscar64/NativeCodeGenerator.h @@ -76,6 +76,7 @@ public: bool ChangesCarry(void) const; bool RequiresAccu(void) const; bool RequiresYReg(void) const; + bool RequiresXReg(void) const; bool ChangesYReg(void) const; bool ChangesXReg(void) const; bool ChangesZeroPage(int address) const;