Re: LZ: manipulations


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

Re: LZ: manipulations



On Thu, 8 Aug 1996, Will Stokes (3D Diamond productions) wrote:


> 
> 
> 				   wstokes@vertex.ucls.uchicago.edu
> 				   http://www.uic.edu/~hhstokes/index.html
> 				   Will Stokes
> 
> 
> quick and to the point, this is a dumb question I should already know the
> answer to but for some reason I don't.
> 
> other then adding registers can you:
> 
> multiply registers and values? how?


You need a routine for this on the Z80.  6 * 8 is 8 added 6 times.
6 * 8 is also 6 shifted left 3 times.  6 * 10 is 6 shifted left
3 times and then added to 6 shifted left once.  These are some
of the things you can use to write a routine to multiply.


> given register a=5 subtract a from 50 or some other number (50-a)? how?


  ld b,a
  ld a,50
  sub b


> any other manipulations (division) (a = -a) that i can do? How?


Division is the reverse of multiplication with the additional
complication of the remainder.  a = -a can be done with neg or
by subtracting from 0.


Barry


References: