Hi Scott, Here is my long version (15 cycles/instructions): ;w holds input 8-bit value movwf temp andlw 0x0F xorwf temp, f swapf temp, f clrc rlf temp, f subwf temp, w skpz xorlw 247 skpz xorlw 247^9 skpz xorlw 9^18 skpz xorlw 18^27 ;Z - w divides by 9 ;NZ - doesn't Any other ideas? :) Nikolai ---- Original Message ---- From: Scott Dattalo Sent: Friday, June 08, 2001 2:24:43 To: PICLIST@MITVMA.MIT.EDU Subj: [pic]: 9 > On Thu, 7 Jun 2001, Drew Vassallo wrote: >> >For example, the digits in 2736 add up to 18. The digits >> >in 18 add up to 9, so 2736 is an integer multiple of 9. >> >> This might be able to be done in 12 instructions, but any more than 8 or 9 >> bits might be a stretch. >> >> Scott, if you can't offer a solution to your own question, especially in >> this area, then we're all in trouble :) > Hint: > 16 = 18 - 2 > :) > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.