Re: LZ: USGARD Question


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

Re: LZ: USGARD Question



>I agree.  By eliminating the "ld de, (PROGRAM_ADDR)" and "add hl,de"
>you're only saving 21 clock cycles, probably translating to only a few
>micro-seconds...  (Remember this processor does SEVERAL MILLION cycles 
>a second...)

Are you sure?  My timing sheet says that
LD DE,(NN) = 20 cycles
ADD HL,DE = 15 cycles

for a total of 5.833 microseconds (assuming a 6Mhz clock rate)

Although that may not be much for one single time, if pointers are
loaded frequently, it does make a difference.

For CALL_(whatever) and the similar functions, which are frequently
used in the middle of games, there is a much bigger speed increase
with relocs as ZShell must first take the value off the stack, load the
offset from that and add PROGRAM_ADDR to it.  In addition, whenever it
is a call or a jump that is not carried out, you must also add to the
value pushed by the call into ZShell to find out where to continue
executing.  I don't have the source code to this so I can't be sure
of the exact timings, but I would guess well over 100 cycles.

--
Patrick Davidson (ariwsi@juno.com)
Visit my home page!  Stuff for Amiga, TI-85 ,TI-92, even DOS!
http://www.calweb.com/~kwdavids/patrick/
http://www.toptown.com/hp/ariwsi/


References: