> My dividend is smaller than the divisor (always). > Both are positive numbers. The dividend is in the range 0-128 and the > divisor is in the range 0-256. The only way I know of is to implement it > as a 16-bit by 8-bit divide. But that takes 192 instructions which is a > lot for my application. > > Does anyone have any better idea how to do it? That's a little tricky. The idea is based on a mathematical property of the division. It is REAL FAST and VERY SHORT. ; ; 8bit / 8bit divide routine. ; ; Enter the routine with dividend in 'dividend' and ; divisor in 'divisor'. ; ; Return truncated result of dividend/divisor in W. ; NOTE: dividend MUST BE SMALLER than divisor. ; div8x8 retlw 0 (Sorry but I couldn't resist :-)))) Marco