Login
Back to forumSee the full topicGo to last reply

Posted By

SomeGuy
on 2021-03-18
19:38:56
 Re: ASCII Art Mandelbrot

I've been comparing some old C64 books and Plussy memory maps.

I think one big stinker for the +4 BASIC speed is that CHRGET, the bedrock of parsing for the BASIC interpreter that gets the next characters, was moved out of zero page (where it lives in C64). It also has to deal with the banking of course too, in order to access RAM under ROMs on the +4, but I have to wonder why in the heck the Commodore guys wasted zero-page space with things like tempspace for "RENUMBER" or increment values for the "AUTO" line numbering, etc, when they did the 3.5 updates. Part of the problem is that owing to the switching of interrupts to deal with banking, CHRGET is also LONGER on the +4 which means its too long to fit in the 24 bytes of ZP wasted on being reserved for the "speech" functions ($d0-)

I encourage everyone to use MONITOR to get the disassembly for +4 CHRGET at $473 to $493.

Note the code disabling interrupts switching to RAM, then grabbing the next character, then back to ROM and enable interrupts. Every. Single. CHRGET it does this. Talk about a drag compared to C64 BASIC interpreter. Notice also there are three branches that could benefit from ZP addressing, which would save 3 bytes and add a bit of speed. Its actually more interesting than that, because the CHRGET on 64 (as disassembled in the "Mapping the C64" book) while mostly identical to the +4 version (except for the banking stuff) is also self modifying in that it actually stores the pointer to the next character in the operand to the equivalent of the LDA at $047F in the plus4 version. Doing the same trick on the Plussy still would not leave the routine small enough to fit in the ZP area wasted by being reserved for "speech" functions, largely due to the 8 bytes used by the code that cuts/restores interrupts and does the banking.

At any rate, that's GOT to be a lot of the problem in terms of the speed deficit on the +4: One of the most fundamental parts of the interpreter gets to do its work in ZP on the C64 and isn't burdened by the banking stuff. Not really sure what could be done about that, TBH. Still shaking my head on why little used (or not speed dependent) stuff like RENUMBER or AUTO have stuff clogging up ZP, not to mention the waste of space there for a speech functionality that was never actually released. Sigh.



Back to top


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon