home *** CD-ROM | disk | FTP | other *** search
- The assembler multiplication command, MUL ,should only be used when the
- multiplier is unknown. But calculating a faster method using the other
- commands can be quite difficult and MUL is often used for ease instead
- of speed.
- For instance, to multiply a number by 7 you can use:
-
- RSB R0,R0,R0,LSL #3
-
- which only requires one registor compared to MUL's three. The advantages
- of using this method are abvious and the program ArmMUL is my attempt at
- a program which caluclates the assembler code required for a given
- multiple.
- It is not as fast as the routines used by Acorn's C Compiler - but this is
- the quickest method I could come up with.
-
- Note: the code ArmMUL produces has not been extensively tested.
-
- Dean Sivell
-