Re: A83: Re: Re: Re: Re: Problem with a program


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

Re: A83: Re: Re: Re: Re: Problem with a program




> But, your loop requires that the value be > 255, which is a major
> disadvantage in most cases.  It is a little bit more efficient, however.
> You save 9 t-states per loop cycle (which is pretty trivial, especially if
> you unroll).

Ah, got me there. Little error in my routine. The DEC/INC/INC-part should be
BEFORE the byte-swap part... So it should be like this:

dec bc    ;preloop-part...
inc b
inc c
ld a,c
ld c,b
ld b,a
Loop:    ;the loop itself...
xxx
xxx
xxx
djnz Loop
dec c
jr nz,Loop

There, now it works like it should work.
And believe me, the speed >rocks< (for a 16-bit loop).


~Grauw


--
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
          email me: laurensh@geocities.com or ICQ: 10196372
             visit the Datax homepage at http://datax.cjb.net/
MSX fair Bussum / MSX Marathon homepage: http://msxfair.cjb.net/
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<



References: