Re: A83: Errors
[Prev][Next][Index][Thread]
Re: A83: Errors
On 11-Apr-98, Trey Jazz wrote:
> ldir?
>
> ld hl,$xxxx ;xxxx is a 16 bit address
> ld de,$xxxx ;same
> ld b,$xx ;number of bytes to copy
> ldir ;copy the bytes from hl to hl+b => de to de+b
One error here; *bc* contains the number of bytes, not b. In cpir and those
block compare functions you can only have
an 8-bit size, but in ldi, ldd, ldir and lddr you use the 16-bit bc register.
These instructions are actually the secret behind the
weird register NAMES: "hl" is ofcourse "high-low" as usual, but "de" is
"destination" and "bc" is "byte count".
Linus Akesson, new here around
References: