Yes and No to that.
CurtisP wrote:With the rare exception of customized ROMs to fix bugs, I think you can assume that every VIC 20 is going to have the exact same Basic ROM.
When I wrote my last post here in this thread, I did not refer to
that other project, where I exchanged the BASIC ROM in my VIC-20.
Rather, I pointed to some 'standards' a
wedge in the BASIC interpreter has to honor with regard to register usage, flag register usage, RAM usage and other side effects. Any such wedge should in principle
behave as if it wasn't there, and from that point on carefully nudge the BASIC interpreter into doing a slightly different, but intended action.
Sadly enough, that's not the case with the USR() function you posted in
another thread. You surely don't want a function to print out something
during expression evaluation. The Right Thing™ would have been to return a string with the hex data.
So if you want to save those few bytes, I don't see a problem with tracking the register usage.
I'm just not sure it's always worth the trouble.
For the bug-fix I made myself exactly that trouble to make sure the replacement routine returns with exactly the same register and flag values than the original. What's different now is, that the result in FAC#1 is now correct in all cases. I did this without shuffling around code, which would have broken lots of programs. Rather, I just diverted a single jump to the (sometimes malfunctioning) routine that shifts the mantissa one whole byte, and provided a replacement in some otherwise unused space of the ROM.