BRK masking bug and reliability of B pseudoflag
Moderator: Moderators
Re: BRK masking bug and reliability of B pseudoflag
STA $8000 would never be followed by a STP, unlike BRK.
-
- Posts: 1079
- Joined: Tue Feb 07, 2017 2:03 am
Re: BRK masking bug and reliability of B pseudoflag
Here is the VICE test that, tests the B flag and shows that a BRK can abort an NMI https://sourceforge.net/p/vice-emu/code ... cpu_bugs.s
Re: BRK masking bug and reliability of B pseudoflag
This is getting pretty ridiculous just to save a byte per function call. If you're that strapped for space, look up the paper implementing a huffman code interpreter (without decompression, it's a streaming thing), and yay, your code size just went to 0.6-0.8.
-
- Posts: 1079
- Joined: Tue Feb 07, 2017 2:03 am
Re: BRK masking bug and reliability of B pseudoflag
with a massive const cost of the decoder, the table and you now have to run all of your code from the 2K or RAM so you need to unpack run unpack run.
-
- Posts: 31
- Joined: Wed Sep 09, 2020 3:08 am
Re: BRK masking bug and reliability of B pseudoflag
As calima suggests, you can "unpack" the code into program counter as it goes (with a few bytes of RAM used for bitstream's program counter and such, but not loads of it). You lose some performance for tight loops, besides that it's an overall win. I can see that being a useful technique for rarely executed code like RPG NPC scripting. It could be still combined with BRK though, in more ways than one.
-
- Posts: 1079
- Joined: Tue Feb 07, 2017 2:03 am