fix register overwriting for certain subroutine call parameter combinations. Fixes #136

This commit is contained in:
Irmen de Jong
2024-07-02 23:16:57 +02:00
parent e7298f8162
commit 43c55b58d2
3 changed files with 13 additions and 9 deletions

View File

@@ -1,9 +1,7 @@
TODO
====
https://github.com/irmen/prog8/issues/136 (string.find register order issue)
other issues on github.
See open issues on github.
optimize signed byte/word division by powers of 2 (and shift right?), it's now using divmod routine. (also % ?)
see inplacemodificationByteVariableWithLiteralval() and inplacemodificationSomeWordWithLiteralval()
@@ -30,6 +28,12 @@ optimize signed byte/word division by powers of 2 (and shift right?), it's now u
lda $4
Improve register load order in subroutine call args assignments:
in certain situations, the "wrong" order of evaluation of function call arguments is done which results
in overwriting registers that already got their value, which requires a lot of stack juggling (especially on plain 6502 cpu!)
Maybe this routine can be made more intelligent. See usesOtherRegistersWhileEvaluating() and argumentsViaRegisters().
Future Things and Ideas
^^^^^^^^^^^^^^^^^^^^^^^
Compiler: