Re: A86: a question


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

Re: A86: a question




On Thu, 16 Apr 1998 00:33:39 +0200 Jimmy =?iso-8859-1?Q?M=E5rdell?=
<yarin@acc.umu.se> writes:
[...]
>>like ld de,(ix+hl)?
>
>ex de,hl    ; 1 cycle,   4 T states
>add ix,de   ; 4 cycles, 15 T states
>ld e,(ix)   ; 5 cycles, 19 T states
>ld d,(ix+1) ; 5 cycles, 19 T states
>
>is the most straightforward solution, and probably the fastest
>as well. Maybe you can use some undocumented instructions to
>speed it up. add ix,hl shouldn't be possible though.

That's the first way I thought of (57 T states), but a second method that
might work is:

push ix       ; 15 T states
pop de        ; 10 T states
add hl,de     ; 11 T states
ld e,(hl)     ; 7  T states
inc hl        ; 6  T states
ld d,(hl)     ; 7  T states
---------------------------
              ; 56 T states

It may be a little larger, but if you call it (or whatever) very often
then the 1 less T state could add up quickly and outweigh the extra
space.  Also this method doesn't destroy ix.  It does destroy hl, but to
preserve the input data "push hl...pop hl" is 8 T states less than "push
ix...pop ix" (therefore still the faster method:-).


Sincerely,
The Unibomer

Jared Ivey
Unibomer@Juno.com
http://www.geocities.com/SiliconValley/Vista/7342

"Do not use a hatchet to remove a fly from your friend's forehead." --
Chinese Proverb


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


Follow-Ups: References: