You may recall brum103's excellent post in:
...where a divide 8 bit number by 10 algorithm is given as:
; the input number must be in register "input" ; value/10 is in register "result" ; register temp1 and R1:R0 are clobbered div10: ldi temp1, 205 mul temp1, input lsr R1 lsr R1 lsr R1 mov result, R1 ret
I've been trying and failing to extend this to multiplying an 8 bit number by n/10ths eg 178 * 9/10, or 36 * 2/10 or whatever.
- good accuracy - being out by 'a few' is OK, but spot on would be better!
- very high speed - at the expense of code size if required
My head's hurting - any ideas fellow Freaks?