Skip to content

Commit

Permalink
issue #85 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tebe6502 committed Apr 12, 2022
1 parent 8aad0ef commit 82090de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/CHANGELOG
@@ -1,5 +1,6 @@
11.04.2022
- dodany modyfikator KEEP dla procedur/funkcji, oznaczona w ten sposób procedura/funkcja zostanie zawsze skompilowana
- issue #85 fixed ('opt_ADR.inc')

10.04.2022
- modyfikator REGISTER dla funkcji spowoduje alokację wartości funkcji na stronie zerowej (typy proste)
Expand Down
12 changes: 6 additions & 6 deletions src/mp.pas
Expand Up @@ -10550,7 +10550,7 @@ function OptimizeEAX: Boolean;
}


if ADD_SUB_STACK(i) or ADC_SBC_STACK(i) or AND_ORA_EOR_STACK(i) then // add|sub|adc|sbc STACK
if (ADD_SUB_STACK(i) or ADC_SBC_STACK(i) or AND_ORA_EOR_STACK(i)) and (pos('_EAX', listing[i]) = 0) then // add|sub|adc|sbc STACK
begin

tmp:=copy(listing[i], 6, 256);
Expand All @@ -10565,10 +10565,10 @@ function OptimizeEAX: Boolean;
listing[i] := copy(listing[i], 1, 5) + copy(listing[p-1], 6, 256);

if sta(p+1) then
//listing[p] := ''
listing[p] := ''
else begin
//listing[p-1] := '';
//listing[p] := '';
listing[p-1] := '';
listing[p] := '';
end;

Result:=false; Break;
Expand Down Expand Up @@ -10621,7 +10621,7 @@ function OptimizeEAX: Boolean;
end;


if lda_stack(i) and (pos('EAX', listing[i]) = 0) and // lda :STACKORIGIN ; 0
if lda_stack(i) and (pos('_EAX', listing[i]) = 0) and // lda :STACKORIGIN ; 0
sta_a(i+1) and (iy(i+1) = false) and // sta ; 1
(pos(':bp2', listing[i+1]) = 0) and
(sta_a(i+2) = false) and (tay(i+2) = false) and // ~sta ; 2
Expand Down Expand Up @@ -13602,7 +13602,7 @@ function OptimizeEAX: Boolean;


{
if (pos('lda :STACKORIGIN+12', listing[i]) > 0) then begin
if (pos(':ecx+1', listing[i]) > 0) then begin

for p:=0 to l-1 do writeln(listing[p]);
writeln('-------');
Expand Down
1 change: 1 addition & 0 deletions src/opt_ADR.inc
Expand Up @@ -14,6 +14,7 @@
tmp:=#9'sta ' + copy(listing[i], 6, 256);

for p:=i-1 downto 0 do
if onBreak(p) then Break else
if listing[p] = tmp then begin

// -----------------------------------------------------------------------------
Expand Down

0 comments on commit 82090de

Please sign in to comment.