Closed SamCoVT closed 5 months ago
+!
is the culprit using tmp1, so just that word needs to be rewritten in assembly. Tali doesn't use the upper half of zero page, so we'll just use a location there during the tests.
While +!
can't be used because it uses a tmp variable, @
, +1
, and !
are fine to use, so I just rewrote in Forth using those words.
I did write a fully assembly version first - shoutout to @patricksurry for adding the calculated branch addresses to the disassembler because I had to count bytes to determine a forward branch and it was nice to use see
on the resulting word and verify the branch went exactly where I wanted it to.
I ultimately decided to do this mostly in Forth, as it will be easier for others to understand and modify if ever needed.
Excellent.
The test suite saves tmp1 in the I/O redirection word because it is modified by at least one of the forth words used in that word. The solution is to completely rewrite that word in assembly to eliminate the use of tmp1.
This needs to wait for PR #54 as it will replace the band-aid there with a complete solution.