[A83] Re: Signed division by a power of two.


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

[A83] Re: Signed division by a power of two.



JP is 10 always. JR is 12/7 (taken/not taken). So in fact, a JR is
faster if you design your routine to not take the conditional more often
than it does.

FYI, JP can't possibly be 1 because it takes more than 1 cycle just to
read the instrcution bytes. Check out how many cycles it takes to do a
"ld hl,NNNN"  .. that's the slow down, is reading the instruction from
the bus. And then the conditional case of JR takes longer because it has
to add the offset to PC, and on the non-conditional case, we can just
skip doing the math, saving time.

So, if 60% of the time you take the conditional, you come out about even
in time.. if you take it anymore, then you stand to gain time by using
jp.. if you take it less, you stand to gain time by using jr.. if you
are close to 60%, then you can at least gain byte by using jr.

--
Scott Dial
scott@scottdial.com
AIM GeekMug : ICQ# 3608935


-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org] On Behalf Of pad
Sent: Wednesday, August 13, 2003 5:45 PM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: Signed division by a power of two.




> No.  Conditional jp's take 10/1 tstates.  Jp is always faster.

10/1?  Sounds to me like that is what you get when you make a table
with a 4 character wide column, but then try to put 10/10 in it...




Follow-Ups: References: