kio.asm
flypie_Ace-2019/testrom/kio.asm
	INCLUDE "IODEFS.H"
	INCLUDE "DEBUGMACROS.H"

	SEGMENT CODE ; MAKE IT THE CURRENT SECTION

	PUBLIC KIO_INIT

	EXTERN INIT_CTC,INIT_PIO,INIT_SIO
	EXTERN	TOEXP


DCNO1	EQU 000000000B	; NONE
DCSCP	EQU 000000001B	; SIO, CTC, PIO
DCSPC	EQU 000000010B	; SIO, PIO, CTC
DCCSP	EQU 000000011B	; CTC, SIO, PTC
DCCPS	EQU 000000100B	; CTC, PIO, SIO
DCPSC1	EQU 000000101B	; PIO, SIO, CTC
DCPSC2	EQU 000000110B	; PIO, SIO, CTC
DCNO2	EQU 000000111B 	; NONE		

DCWE	EQU	000001000B	;DAISY CHAIN WRITE ENABLE

RPIO	EQU 000010000B
RCTC	EQU 000100000B
RSIO	EQU 001000000B

MUXSIO	EQU 010000000B
MUXPIA	EQU 000000000B

KIO_INIT:
	PUSH	AF
	PUSH	BC

	.IFDEF Z84C15
	.ELSE
	DOOUT KIOCMDA , MUXSIO|RSIO|RCTC|RPIO|DCWE|DCCSP
	.ENDIF

	CALL INIT_CTC
	CALL INIT_PIO
	CALL INIT_SIO

	STROUTXY 0H,0BH, "KIOINIT", 07 


	POP	BC
	POP AF
	RET


