DivHLC

Description #

Divides a 16-bit dividend by an 8-bit divisor; returns a 16-bit quotient and an 8-bit remainder.

Technical Details #

Special thanks to z80 Bits for the inspiration for this routine.

Inputs #

hl = dividend
c = divisor

Outputs #

hl = quotient a = remainder

Destroyed #

All