base:multiplication_with_a_constant
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
base:multiplication_with_a_constant [2020-04-10 17:25] – tww | base:multiplication_with_a_constant [2021-02-10 01:24] (current) – fix a typo strobe | ||
---|---|---|---|
Line 24: | Line 24: | ||
With this in mind, you can do 2*A + 8*A which saves you the asl $2. Also as long as A cannot be higher than 25, the upper 4 bits (high nybble) will always be #%0000. This means that the asl instructions will never set carry and the clc can be dropped. | With this in mind, you can do 2*A + 8*A which saves you the asl $2. Also as long as A cannot be higher than 25, the upper 4 bits (high nybble) will always be #%0000. This means that the asl instructions will never set carry and the clc can be dropped. | ||
- | This gives the following code to multiply A with 10 (assuming A is less than 25): | + | This gives the following code to multiply A with 10 (assuming A is less than 26): |
< | < |
base/multiplication_with_a_constant.txt · Last modified: 2021-02-10 01:24 by strobe