diff --git a/bin/windows/mp.exe b/bin/windows/mp.exe index 0caf6f30d..b50354d7f 100644 Binary files a/bin/windows/mp.exe and b/bin/windows/mp.exe differ diff --git a/src/include/opt6502/opt_ADD.inc b/src/include/opt6502/opt_ADD.inc index b8e61c226..1bb0f1b72 100644 --- a/src/include/opt6502/opt_ADD.inc +++ b/src/include/opt6502/opt_ADD.inc @@ -458,10 +458,10 @@ begin if add_sub(i) and // add|sub ; 0 - sta_a(i+1) and (sta_stack(i+1) = false) and // sta S ; 1 + sta_val(i+1) and // sta S ; 1 ~sta :STACKORIGN lda_a(i+2) and // lda ; 2 adc_sbc(i+3) and // adc|sbc ; 3 - sta_a(i+4) and (sta_stack(i+4) = false) and // sta S+1 ; 4 + sta_val(i+4) and // sta S+1 ; 4 ~sta :STACKORIGN lda_a(i+5) and // lda ; 5 adc_sbc(i+6) and // adc|sbc ; 6 sta_stack(i+7) and // sta :STACKORIGIN+STACKWIDTH*2 ; 7 @@ -481,7 +481,7 @@ begin if add_sub(i) and // add|sub ; 0 - sta_a(i+1) and (sta_stack(i+1) = false) and // sta S ; 1 + sta_val(i+1) and // sta S ; 1 ~sta :STACKORIGN lda_a(i+2) and // lda ; 2 adc_sbc(i+3) and // adc|sbc ; 3 sta_stack(i+4) and // sta :STACKORIGIN+STACKWIDTH ; 4 @@ -611,13 +611,13 @@ begin adc_sbc(i+4) and // adc|sbc ; 4 sta_stack(i+5) and // sta :STACKORIGIN+STACKWIDTH+10 ; 5 lda_a(i+6) and (lda_stack(i+6) = false) and // lda ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) and // sta ; 7 + sta_val(i+7) and // sta ; 7 ~sta :STACKORIGN lda_a(i+8) and (lda_stack(i+8) = false) and // lda ; 8 - sta_a(i+9) and (sta_stack(i+9) = false) and // sta ; 9 + sta_val(i+9) and // sta ; 9 ~sta :STACKORIGN lda_stack(i+10) and // lda :STACKORIGIN+10 ; 10 - sta_a(i+11) and (sta_stack(i+11) = false) and // sta ; 11 + sta_val(i+11) and // sta ; 11 ~sta :STACKORIGN lda_stack(i+12) and // lda :STACKORIGIN+STACKWIDTH+10 ; 12 - sta_a(i+13) and (sta_stack(i+13) = false) then // sta ; 13 + sta_val(i+13) then // sta ; 13 ~sta :STACKORIGN if (copy(listing[i+2], 6, 256) = copy(listing[i+10], 6, 256)) and (copy(listing[i+5], 6, 256) = copy(listing[i+12], 6, 256)) then begin @@ -832,10 +832,10 @@ begin if add_sub_val(i) and // add|sub ; 0 2023-01-26 - sta_a(i+1) and (sta_stack(i+1) = false) and // sta A ; 1 + sta_val(i+1) and // sta A ; 1 ~sta :STACKORIGN lda_a(i+2) and // lda ; 2 adc_sbc_val(i+3) and // adc|sbc ; 3 - sta_a(i+4) and (sta_stack(i+4) = false) and // sta A+1 ; 4 + sta_val(i+4) and // sta A+1 ; 4 ~sta :STACKORIGN lda_a(i+5) and // lda A ; 5 sta_stack(i+6) and // sta :STACKORIGIN ; 6 lda_a(i+7) and // lda A+1 ; 7 diff --git a/src/include/opt6502/opt_ASL.inc b/src/include/opt6502/opt_ASL.inc index e9bd0b5e8..93c84ddc5 100644 --- a/src/include/opt6502/opt_ASL.inc +++ b/src/include/opt6502/opt_ASL.inc @@ -222,9 +222,9 @@ begin lda_a(i+2) and // lda ; 2 asl_stack(i+3) and // asl :STACKORIGIN ; 3 rol_a(i+4) and // rol @ ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and // sta ; 5 + sta_val(i+5) and // sta ; 5 ~sta :STACKORIGN lda_stack(i+6) and // lda :STACKORIGIN ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) and (iy(i+7) = false) then // sta ; 7 + sta_val(i+7) and (iy(i+7) = false) then // sta ; 7 ~sta :STACKORIGN if (copy(listing[i+1], 6, 256) = copy(listing[i+3], 6, 256)) and (copy(listing[i+3], 6, 256) = copy(listing[i+6], 6, 256)) then begin @@ -568,9 +568,9 @@ begin rol_stack(i+2) and // rol :STACKORIGIN+STACKWIDTH*2 ; 2 rol_stack(i+3) and // rol :STACKORIGIN+STACKWIDTH*3 ; 3 lda_stack(i+4) and // lda :STACKORIGIN ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and (EAX(i+5) = false) and // sta ; 5 + sta_val(i+5) and (EAX(i+5) = false) and // sta ; 5 ~sta :STACKORIGN lda_stack(i+6) and // lda :STACKORIGIN+STACKWIDTH ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) and (EAX(i+7) = false) and // sta ; 7 + sta_val(i+7) and (EAX(i+7) = false) and // sta ; 7 ~sta :STACKORIGN (lda_stack(i+8) = false) then //~lda :STACKORIGIN+STACKWIDTH*2 ; 8 if (copy(listing[i], 6, 256) = copy(listing[i+4], 6, 256)) and (copy(listing[i+1], 6, 256) = copy(listing[i+6], 6, 256)) then begin @@ -595,9 +595,9 @@ begin rol_stack(i+1) and // rol :STACKORIGIN+STACKWIDTH ; 1 rol_stack(i+2) and // rol :STACKORIGIN+STACKWIDTH*2 ; 2 lda_stack(i+3) and // lda :STACKORIGIN+STACKWIDTH ; 3 - sta_a(i+4) and (sta_stack(i+4) = false) and (EAX(i+4) = false) and // sta ; 4 + sta_val(i+4) and (EAX(i+4) = false) and // sta ; 4 ~sta :STACKORIGN lda_stack(i+5) and // lda :STACKORIGIN+STACKWIDTH*2 ; 5 - sta_a(i+6) and (sta_stack(i+6) = false) and (EAX(i+6) = false) and // sta ; 6 + sta_val(i+6) and (EAX(i+6) = false) and // sta ; 6 ~sta :STACKORIGN (lda_stack(i+7) = false) then //~lda :STACKORIGIN ; 7 if (copy(listing[i+1], 6, 256) = copy(listing[i+3], 6, 256)) and (copy(listing[i+2], 6, 256) = copy(listing[i+5], 6, 256)) then begin @@ -639,9 +639,9 @@ begin if asl_stack(i) and // asl :STACKORIGIN ; 0 rol_stack(i+1) and // rol :STACKORIGIN+STACKWIDTH ; 1 lda_stack(i+2) and // lda :STACKORIGIN ; 2 - sta_a(i+3) and (sta_stack(i+3) = false) and (EAX(i+3) = false) and // sta ; 3 + sta_val(i+3) and (EAX(i+3) = false) and // sta ; 3 ~sta :STACKORIGN lda_stack(i+4) and // lda :STACKORIGIN+STACKWIDTH ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and (EAX(i+5) = false) and // sta ; 5 + sta_val(i+5) and (EAX(i+5) = false) and // sta ; 5 ~sta :STACKORIGN (lda_stack(i+6) = false) then //~lda :STACK ; 6 if (copy(listing[i], 6, 256) = copy(listing[i+2], 6, 256)) and (copy(listing[i+1], 6, 256) = copy(listing[i+4], 6, 256)) then begin @@ -705,7 +705,7 @@ begin rol_stack(i+2) and // rol :STACKORIGIN+STACKWIDTH*2 ; 2 rol_stack(i+3) and // rol :STACKORIGIN+STACKWIDTH*3 ; 3 lda_stack(i+4) and // lda :STACKORIGIN ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and (EAX(i+5) = false) and // sta ; 5 + sta_val(i+5) and (EAX(i+5) = false) and // sta ; 5 ~sta :STACKORIGN (lda_stack(i+6) = false) then //~lda :STACKORIGIN+STACKWIDTH*2 ; 8 if (copy(listing[i], 6, 256) = copy(listing[i+4], 6, 256)) then begin @@ -756,7 +756,7 @@ begin asl_stack(i+1) and // asl :STACKORIGN ; 1 rol_stack(i+2) and // rol :STACKORIGIN+STACKWIDTH ; 2 lda_stack(i+3) and // lda :STACKORIGIN+STACKWIDTH ; 3 - sta_a(i+4) and (sta_stack(i+4) = false) and // sta ; 4 + sta_val(i+4) and // sta ; 4 ~sta :STACKORIGN (lda_stack(i+5) = false) then //~lda :STACKORIGIN+ ; 5 if (copy(listing[i], 6, 256) = copy(listing[i+2], 6, 256)) and (copy(listing[i+2], 6, 256) = copy(listing[i+3], 6, 256)) then @@ -773,7 +773,7 @@ begin if asl_stack(i) and // asl :STACKORIGN ; 0 rol_stack(i+1) and // rol :STACKORIGIN+STACKWIDTH ; 1 lda_stack(i+2) and // lda :STACKORIGIN ; 2 - sta_a(i+3) and (sta_stack(i+3) = false) and (EAX(i+3) = false) and // sta ; 3 + sta_val(i+3) and (EAX(i+3) = false) and // sta ; 3 ~sta :STACKORIGN (lda_stack(i+4) = false) then //~lda :STACKORIGIN+STACKWIDTH ; 4 if (copy(listing[i], 6, 256) = copy(listing[i+2], 6, 256)) then begin @@ -1108,7 +1108,7 @@ begin rol_stack(i+2) and // rol :STACKORIGIN+STACKWIDTH ; 2 lda_a(i+3) and (lda_stack(i+3) = false) and // lda ; 3 add_stack(i+4) and // add :STACKORIGIN+STACKWIDTH ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) then // sta ; 5 + sta_val(i+5) then // sta ; 5 ~sta :STACKORIGN if (copy(listing[i], 6, 256) = copy(listing[i+2], 6, 256)) and (copy(listing[i+2], 6, 256) = copy(listing[i+4], 6, 256)) then begin @@ -1301,10 +1301,10 @@ begin lda_stack(i+6) and // lda :STACKORIGIN ; 6 add_sub_val(i+7) and // add|sub ; 7 - sta_a(i+8) and (sta_stack(i+8) = false) and // sta ; 8 + sta_val(i+8) and // sta ; 8 ~sta :STACKORIGN lda_stack(i+9) and // lda :STACKORIGIN+STACKWIDTH ; 9 adc_sbc_val(i+10) and // adc|sbc ; 10 - sta_a(i+11) and (sta_stack(i+11) = false) then // sta ; 11 + sta_val(i+11) then // sta ; 11 ~sta :STACKORIGN if ((copy(listing[i+1], 6, 256) = copy(listing[i+4], 6, 256))) and ((copy(listing[i+3], 6, 256) = copy(listing[i+5], 6, 256))) and ((copy(listing[i+4], 6, 256) = copy(listing[i+6], 6, 256))) and diff --git a/src/include/opt6502/opt_BP.inc b/src/include/opt6502/opt_BP.inc index eb7a0b30d..7259b9589 100644 --- a/src/include/opt6502/opt_BP.inc +++ b/src/include/opt6502/opt_BP.inc @@ -64,7 +64,7 @@ begin sta_stack(i+2) and // sta :STACKORIGIN+STACKWIDTH ; 2 ldy_im(i+3) and // ldy # ; 3 LDA_BP2_Y(i+4) and // lda (:bp2),y ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and // sta ; 5 + sta_val(i+5) and // sta ; 5 ~sta :STACKORIGN lda_stack(i+6) then // lda :STACKORIGIN+STACKWIDTH ; 6 if (copy(listing[i+2], 6, 256) = copy(listing[i+6], 6, 256)) then begin diff --git a/src/include/opt6502/opt_EOR.inc b/src/include/opt6502/opt_EOR.inc index 389d6651e..1f069d83d 100644 --- a/src/include/opt6502/opt_EOR.inc +++ b/src/include/opt6502/opt_EOR.inc @@ -325,10 +325,10 @@ begin and_ora_eor(i+1) and // and|ora|eor ; 1 sta_stack(i+2) and // sta :STACKORIGIN ; 2 lda_a(i+3) and // lda ; 3 - sta_a(i+4) and (sta_stack(i+4) = false) and // sta ; 4 + sta_val(i+4) and // sta ; 4 ~sta :STACKORIGN lda_stack(i+5) and // lda :STACKORIGIN ; 5 and_ora_eor(i+6) and // and|ora|eor ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) then // sta ; 7 + sta_val(i+7) then // sta ; 7 ~sta :STACKORIGN if copy(listing[i+2], 6, 256) = copy(listing[i+5], 6, 256) then begin listing[i+2] := listing[i+6]; diff --git a/src/include/opt6502/opt_LDA.inc b/src/include/opt6502/opt_LDA.inc index d1cf08ef5..06316277b 100644 --- a/src/include/opt6502/opt_LDA.inc +++ b/src/include/opt6502/opt_LDA.inc @@ -278,10 +278,10 @@ begin sta_stack(i+3) and // sta :STACKORIGIN+STACKWIDTH+10 ; 3 lda_stack(i+4) and // lda :STACKORIGIN+9 ; 4 AND_ORA_EOR_STACK(i+5) and // and|ora|eor :STACKORIGIN+10 ; 5 - sta_a(i+6) and (sta_stack(i+6) = false) and // sta ; 6 + sta_val(i+6) and // sta ; 6 ~sta :STACKORIGN lda_stack(i+7) and // lda :STACKORIGIN+STACKWIDTH+9 ; 7 AND_ORA_EOR_STACK(i+8) and // and|ora|eor :STACKORIGIN+STACKWIDTH+10 ; 8 - sta_a(i+9) and (sta_stack(i+9) = false) then // sta ; 9 + sta_val(i+9) then // sta ; 9 ~sta :STACKORIGN if (copy(listing[i+1], 6, 256) = copy(listing[i+5], 6, 256)) and (copy(listing[i+3], 6, 256) = copy(listing[i+8], 6, 256)) and (copy(listing[i], 6, 256) <> copy(listing[i+4], 6, 256)) and @@ -308,10 +308,10 @@ begin sta_stack(i+3) and // sta :STACKORIGIN+STACKWIDTH ; 3 lda_a(i+4) and (lda_stack(i+4) = false) and // lda ; 4 AND_ORA_EOR_STACK(i+5) and // and|ora|eor :STACKORIGIN ; 5 - sta_a(i+6) and (sta_stack(i+6) = false) and // sta ; 6 + sta_val(i+6) and // sta ; 6 ~sta :STACKORIGN lda_a(i+7) and (lda_stack(i+7) = false) and // lda ; 7 AND_ORA_EOR_STACK(i+8) and // and|ora|eor :STACKORIGIN+STACKWIDTH ; 8 - sta_a(i+9) and (sta_stack(i+9) = false) then // sta ; 9 + sta_val(i+9) then // sta ; 9 ~sta :STACKORIGN if (copy(listing[i+1], 6, 256) = copy(listing[i+5], 6, 256)) and (copy(listing[i+3], 6, 256) = copy(listing[i+8], 6, 256)) then begin @@ -768,9 +768,9 @@ begin if lda_stack(i) and // lda :STACKORIGIN ; 0 sta_stack(i+1) and // sta :STACKORIGIN+STACKWIDTH ; 1 lda_a(i+2) and (lda_stack(i+2) = false) and // lda ; 2 - sta_a(i+3) and (sta_stack(i+3) = false) and // sta A ; 3 + sta_val(i+3) and // sta A ; 3 ~sta :STACKORIGN lda_stack(i+4) and // lda :STACKORIGIN+STACKWIDTH ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) then // sta A+1 ; 5 + sta_val(i+5) then // sta A+1 ; 5 ~sta :STACKORIGN if (copy(listing[i+1], 6, 256) = copy(listing[i+4], 6, 256)) then begin listing[i+4] := listing[i]; @@ -1042,13 +1042,13 @@ begin if (lda_a(i) = false) and //~lda ; 0 - sta_a(i+1) and (sta_stack(i+1) = false) and // sta A ; 1 + sta_val(i+1) and // sta A ; 1 ~sta :STACKORIGN lda_stack(i+2) and // lda :STACKORIGIN ; 2 - sta_a(i+3) and (sta_stack(i+3) = false) and // sta A+1 ; 3 + sta_val(i+3) and // sta A+1 ; 3 ~sta :STACKORIGN lda_a(i+4) and // lda A ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and // sta ; 5 + sta_val(i+5) and // sta ; 5 ~sta :STACKORIGN lda_a(i+6) and // lda A+1 ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) then // sta ; 7 + sta_val(i+7) then // sta ; 7 ~sta :STACKORIGN if (copy(listing[i+1], 6, 256) = copy(listing[i+4], 6, 256)) and (copy(listing[i+3], 6, 256) = copy(listing[i+6], 6, 256)) then begin @@ -1066,9 +1066,9 @@ begin lda_a(i+2) and (lda_stack(i+2) = false) and // lda ; 2 sta_stack(i+3) and // sta :STACKORIGIN+STACKWIDTH ; 3 lda_stack(i+4) and // lda :STACKORIGIN ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and // sta ; 5 5 <> 2 !!! + sta_val(i+5) and // sta ; 5 5 <> 2 !!! ~sta :STACKORIGN lda_stack(i+6) and // lda :STACKORIGIN+STACKWIDTH ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) then // sta ; 7 + sta_val(i+7) then // sta ; 7 ~sta :STACKORIGN if (copy(listing[i], 6, 256) <> copy(listing[i+2], 6, 256)) and (copy(listing[i+1], 6, 256) <> copy(listing[i+3], 6, 256)) and (copy(listing[i+1], 6, 256) = copy(listing[i+4], 6, 256)) and @@ -1087,9 +1087,9 @@ begin if lda_a(i) and (lda_stack(i) = false) and // lda ; 0 sta_stack(i+1) and // sta :STACKORIGIN ; 1 lda_a(i+2) and (lda_stack(i+2) = false) and // lda ; 2 - sta_a(i+3) and (sta_stack(i+3) = false) and // sta ; 3 + sta_val(i+3) and // sta ; 3 ~sta :STACKORIGN lda_stack(i+4) and // lda :STACKORIGIN ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) then // sta ; 5 + sta_val(i+5) then // sta ; 5 ~sta :STACKORIGN if (copy(listing[i], 6, 256) <> copy(listing[i+3], 6, 256)) and (copy(listing[i+1], 6, 256) = copy(listing[i+4], 6, 256)) then begin @@ -1120,9 +1120,9 @@ begin if //(lda_a(i) = false) and //~lda ; 0 - sta_a(i+1) and (sta_stack(i+1) = false) and // sta A ; 1 + sta_val(i+1) and // sta A ; 1 ~sta :STACKORIGN lda_stack(i+2) and // lda :STACKORIGIN+STACKWIDTH ; 2 - sta_a(i+3) and (sta_stack(i+3) = false) and // sta A+1 ; 3 + sta_val(i+3) and // sta A+1 ; 3 ~sta :STACKORIGN lda_a(i+4) and (lda_stack(i+4) = false) and // lda A ; 4 sta_stack(i+5) and // sta :STACKORIGIN ; 5 lda_a(i+6) and (lda_stack(i+6) = false) and // lda A+1 ; 6 diff --git a/src/include/opt6502/opt_LDY.inc b/src/include/opt6502/opt_LDY.inc index 4f8c07a3f..c46e3c342 100644 --- a/src/include/opt6502/opt_LDY.inc +++ b/src/include/opt6502/opt_LDY.inc @@ -84,7 +84,7 @@ begin if lda_a(i) and (lda_stack(i) = false) and (lda_im(i) = false) and // lda I ; 0 add_sub(i+1) and // add|sub ; 1 - sta_a(i+2) and (sta_stack(i+2) = false) and // sta ; 2 + sta_val(i+2) and // sta ; 2 ~sta :STACKORIGN ldy(i+3) then // ldy I ; 3 if copy(listing[i], 6, 256) = copy(listing[i+3], 6, 256) then begin @@ -191,7 +191,7 @@ begin lda_a(i+2) and (lda_stack(i+2) = false) and // lda ; 2 add_sub_val(i+3) and // add|sub ; 3 ldy_stack(i+4) and // ldy :STACKORIGIN ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) then // sta ; 5 + sta_val(i+5) then // sta ; 5 ~sta :STACKORIGN if (copy(listing[i], 6, 256) = copy(listing[i+4], 6, 256)) then begin listing[i] := ''; diff --git a/src/include/opt6502/opt_SPL.inc b/src/include/opt6502/opt_SPL.inc index ff9243df4..7b596a10d 100644 --- a/src/include/opt6502/opt_SPL.inc +++ b/src/include/opt6502/opt_SPL.inc @@ -709,9 +709,9 @@ begin if sty_stack(i+4) and // sty :STACKORIGIN+STACKWIDTH ; 4 - sta_a(i+5) and (sta_stack(i+5) = false) and // sta ; 5 + sta_val(i+5) and // sta ; 5 ~sta :STACKORIGN lda_stack(i+6) and // lda :STACKORIGIN+STACKWIDTH ; 6 - sta_a(i+7) and (sta_stack(i+7) = false) and // sta ; 7 + sta_val(i+7) and // sta ; 7 ~sta :STACKORIGN (sta_a(i+8) = false) then //~sta ; 8 if (copy(listing[i+4], 6, 256) = copy(listing[i+6], 6, 256)) then begin