[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 illegal opcodes questions



Am 19.05.2006, 22:34 Uhr, schrieb Eric Smith <eric@brouhaha.com>:

"John Selck" <gpjiweg@t-online.de> writes:
And then we would have ended up like the Z80: That a copy loop is faster
than the actual block copy instruction :D

Can you cite an example?  The block move instructions on the Z80 are
actually fairly efficient.  They use three memory cycles to move a byte,
vs. the theoretical minimum of two.  Doing a block copy via a software
loop is going to require at least five memory cycles per byte moved, and
probably more.

LDIR eats 21 clock cycles per iteration, doing the same with other Z80
instructions can be way faster.

I tried to use the Z80 in the C128 for block copy/fill because I thought
"hey, it has a block copy command, so I guess it is fast" but it wasn't.
Then I tried normal opcodes, it was way faster than using LDIR but still
not faster than copying the stuff with the 8502.

Here's a list of Z80 instruction and their clock cycles:

http://www.ftp83plus.net/Tutorials/z80inset1A.htm