diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c index eae7b705b..07f30df0a 100644 --- a/src/cc65/coptind.c +++ b/src/cc65/coptind.c @@ -942,7 +942,7 @@ unsigned OptDupLoads (CodeSeg* S) * location does already contain the value to be stored, * remove the store. */ - if (CPU >= CPU_65C02 && E->AM == AM65_ZP) { + if ((CPUIsets[CPU] & CPU_ISET_65SC02) != 0 && E->AM == AM65_ZP) { if (ZPRegVal (E->Chg, In) == 0) { Delete = 1; }