Re: A86: help w/ new pud


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

Re: A86: help w/ new pud




Jeanne9005@aol.com wrote:

> but if you did this adding thing, wouldn't you get 5*HL? or are you adding hl
> together,then loading that into another register, and then adding 2*HL to
> that?

Nope. Each add hl,hl adds hl to itself; that is, 2*hl. Thus 
to multiply by 16 you need 16^(1/2) or 4 add hl,hl's.

Remember, multiplication is simply shorthand for repeated 
addition. Its amazing how many times you use simple
algebra to do small tricks in assembly programming. :)

Bryan

-- 
Bryan Rittmeyer
mailto:bryanr@flash.net
http://www.flash.net/~bryanr/


References: