Routine: Chk3
Function: Checks that minimum motor speed < maximum motor speed
Called by: Range
Calls: Error
Entry: Mtrmin, Mtrmax have been set by Chk1 and Chk2
Exit: C flag is set on error
Preserved: None
CHK3 LD A,(MTRMAX)
LD B,A
LD A,(MTRMIN)
SUB A,8
; Make sure that the difference between the maximum and minimum motor speeds is positive and greater than 8.
CP B
JR Z,CHK3A
JR C,CHK3A
RET
CHK3A LD A,5
; Signal an error if the range is too small or the minimum speed greater than the maximum speed.
CALL ERROR
SCF
RET