; Module MHALVE24 ; Steven M. Cohen ; March 10, 1987 ; PUBLIC HALVE24 ; Halves the 24 bit quantity pointed to by HL ; Registers affected : NONE ; Side effect: NONE HALVE24: PUSH AF ;save flags INC HL INC HL ;start with the highest byte OR A RR (HL) ;RR = divide by 2 DEC HL RR (HL) DEC HL RR (HL) POP AF ;restore flags RET