Re: A83: Errors
[Prev][Next][Index][Thread]
Re: A83: Errors
whoa... easy guys. I
wasnt asking what ldir does... I just thought that LDIR couldnt produce a
"range of relative branch exceeded" since the addresses used with HL
and DE are 16 bit.
-Harper Maddox
btw, i bet you <sarcasm> dont know what
"a" stands for </sarcasm> :)
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