
; Update to LSDOS 6.3.1 2022-09-16 dpm

zCKBRKC		; Check and Clear <BREAK> bit SVC.

		PUSH	HL		;Save registers
		LD	HL,KFLAG$	;Point to KFLAG$
		BIT	0,(HL)		;Check break bit
		JR	Z,NOBRK		;and ret if none
		PUSH	AF		;Save flags
		PUSH	BC
		PUSH	DE
BRKTEST		RES	0,(HL) 		;Reset the break bit
		LD	BC,0B00h	;Wait more than 1/30
		CALL	PAUSEz		;of a second
		BIT	0,(HL)		;Test the bit again
		JR	NZ,BRKTEST	;Loop until gone
		LD	DE,KIDCB$	;Point at keyboard &
		LD	A,03		;clear buffer with
		CALL	zCTL		;control 3 call
		POP	DE
		POP	BC		;Recover registers
		POP	AF		;Recover FLAGS
NOBRK		POP	HL
		RET
