*****************************************************************
*								*
*	>>>>>> s o f t d e s i g n <<<<<<			*
*								*
*	c p / m - z 8 0   e m u l a t o r			*
*								*
*	z 8 0   i / o   o p c o d e   s u p p o r t		*
*								*
*	25.11.85						*
*								*
*	configured to access atari 520 st modem port		*
*								*
*****************************************************************


* input parameters:
* z80 port address     : d0.b
* z80 port output data : d1.b

* return parameter: 
* z80 port input data  : d0.b



	.TEXT


EMUIO:	JMP	INPUT
	JMP	OUTPUT


INPUT:	LEA.L	INPTAB(PC),A0
	AND.W	#$000F,D0
	ADD.W	D0,D0
	MOVE.W	(A0,D0.W),D0
	JMP	0(A0,D0.W)


OUTPUT:	LEA.L	OUTTAB(PC),A0
	AND.W	#$000F,D0
	ADD.W	D0,D0
	MOVE.W	(A0,D0.W),D0
	JMP	0(A0,D0.W)



INPTAB:	.DC.W	INP00-INPTAB,INP01-INPTAB,INP02-INPTAB,INP03-INPTAB
	.DC.W	INP04-INPTAB,INP05-INPTAB,INP06-INPTAB,INP07-INPTAB
	.DC.W	INP08-INPTAB,INP09-INPTAB,INP0A-INPTAB,INP0B-INPTAB
	.DC.W	INP0C-INPTAB,INP0D-INPTAB,INP0E-INPTAB,INP0F-INPTAB


OUTTAB:	.DC.W	OUT00-OUTTAB,OUT01-OUTTAB,OUT02-OUTTAB,OUT03-OUTTAB
	.DC.W	OUT04-OUTTAB,OUT05-OUTTAB,OUT06-OUTTAB,OUT07-OUTTAB
	.DC.W	OUT08-OUTTAB,OUT09-OUTTAB,OUT0A-OUTTAB,OUT0B-OUTTAB
	.DC.W	OUT0C-OUTTAB,OUT0D-OUTTAB,OUT0E-OUTTAB,OUT0F-OUTTAB



INP00:
INP01:
INP02:
INP03:	RTS


INP04:	MOVE.W	#1,-(A7)		modem port input status
	MOVE.W	#1,-(A7)
	TRAP	#13
	ADDQ.L	#4,A7
	RTS


INP05:	MOVE.W	#1,-(A7)		modem port output status
	MOVE.W	#8,-(A7)
	TRAP	#13
	ADDQ.L	#4,A7
	RTS


INP06:	MOVE.W	#1,-(A7)		modem port data input
	MOVE.W	#2,-(A7)
	TRAP	#13
	ADDQ.L	#4,A7
	RTS


INP07:
INP08:
INP09:
INP0A:
INP0B:
INP0C:
INP0D:
INP0E:
INP0F:	RTS



OUT00:	
OUT01:
OUT02:
OUT03:	RTS


OUT04:	AND.W	#$00FF,D1		modem port data output
	MOVE.W	D1,-(A7)
	MOVE.W	#1,-(A7)
	MOVE.W	#3,-(A7)
	TRAP	#13
	ADDQ.L	#6,A7
	RTS


OUT05:
OUT06:
OUT07:
OUT08:
OUT09:
OUT0A:
OUT0B:
OUT0C:
OUT0D:
OUT0E:
OUT0F:	RTS


	.END
