I was working in a roundabout way.
CPI has not been a command I have used often but I see how it is efficient in what it does.
I have run into this nasty habit of counting every t-state and trying to get that last byte by using things like JR instead of JP.
This is the way I did it back in the 80's when memory and disk space was hundreds of dollars.
Now it takes me about an hour to do what it took a month 30 years ago.
I follow this forum because the routines have already been fleshed out to the most efficient version.
The crack about using the BIOS was not an insult to the MSX, it is an insult to those like Coleco who rushed their consoles just to meet the Christmas season.
I wrote something that sends patterns to VRAM but because their own BIOS routine to handle that refused to work I had to write my own. If you use theirs you could not go above 255 so you would have to send info in packs of of up to 255 until the entire need was filled. Not only that you had to come up with your own NMI or the data sending to VRAM could get garbled.