Re: LZ: manipulations
[Prev][Next][Index][Thread]
Re: LZ: manipulations
On Sat, 10 Aug 1996 OoooEJoooo@aol.com wrote:
> Which type of these manipulations is most efficient???
>
> Is ld a,5
> ld b,a
> ld a,50
> sub b
>
> More efficient than
>
> ld a,5
> sub 50
> neg
The second one is more efficient. I wrote it without the book
available and I didn't remember for sure that an immediate subract
was valid, so I wrote it the way I was sure would work.
Barry
> And is a loop to add the number being multiplied to itself that # of times
> (i.e. 6 * 8 = 8+8+8+8+8+8)
> more efficient than a loop to shift left (6 * 8 = 6 shifted left three times)
>
> Also, would the shifting method be able to work for #'s that aren't powers of
> 2 (odd #'s)
>
> Finally, could someone explain division and how you would deal with
> remainders.
>
> Thanx,
>
> EJ
> <oo0ej0oo@alpha2.csd.uwm.edu>
>
References: