Prev: 196E Up: Map Next: 1988
1980: THE 'COMPARE LINE NUMBERS' SUBROUTINE
Used by the routines at OUT_LINE and LINE_ADDR.
The given line number in the BC register pair is matched against the addressed line number.
Input
BC First line number
HL Address of the second line number
Output
F Zero flag set if the line numbers match
F Carry flag set if the first line number is greater than the second
CP_LINES 1980 LD A,(HL) Fetch the high byte of the addressed line number and compare it.
1981 CP B
1982 RET NZ Return if they do not match.
1983 INC HL Next compare the low bytes.
1984 LD A,(HL)
1985 DEC HL
1986 CP C
1987 RET Return with the carry flag set if the addressed line number has yet to reach the given line number.
Prev: 196E Up: Map Next: 1988