> By the way, I think your routine contains a bug. This is what you posted:
> ld a,e
> ld b,e
> sub 1 ;If 0, then set carry
> ld a,d
> sbc 0 ;if B=E=0 then A=D-1 (for fast loop)
> But if you run this with DE=#0103, the output is B=#03 and A=#01. This
> means the outer loop won't loop, while it should loop once. So the
> transfered data is #0100 bytes too short. This is also true for your
"fixed
> #4000" transfer (A=#3F instead of #40).
Ah, yes... Now I know what is wrong, thanks!
The SBC 0 has to be ADC A,0
The #3F is stupid. It was #40 but I changed it to #3F recently because I
thought it was wrong, while it was right (I thought it loaded 256 bytes too
much). I had to think better.
Your way is faster, but it doesn't preserve the DE-register and it's only 4
T-states faster...
Anyways, I don't need to preserve the DE-register so that's ok. I will use
your routine.
So you use it too, eh? Did you think of it yourself or did you read about it
in my article in Track?
(would be funny)
> Another note:
> It is possible to tell the BDOS to load #4000 bytes, even though there are
> not that many bytes left in the file. In that case, all the remaining
bytes
> are read and the rest of the bytes are filled with zeroes. After the
Random
> Block Read call, HL contains the number of records actually read.
That's true... But it is only useful if you want to load the complete file
in memory (in that case, it is VERY useful). But if you only want to load
half the image (what is possible in my program, so that you can load one
half to the one page and the onther half to another page) it isn't possible
with your program.
~Grauw
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****