Re: A83: Calculating this formula...


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

Re: A83: Calculating this formula...




If you're using the accumulator, you can save a byte and some cycles:

 add a,a    ; a *2

As for division, this will work, but remember that at the end you will need
to mask off the upper bits:

 rra      ; a / 2
 rra      ; a / 4
 rra      ; a / 8
 and %00011111        ; mask off top 3 bits since we shifted 3 times

> also remember that a / 2 or a * 2 is much faster with shift operations
>
> ie. sla a = a*2
> srl a = a/2





Follow-Ups: References: