;********************************************************************
;*								    *
;*	>>>>>>> S o f t D e s i g n <<<<<<<		17.1.86	    *
;*								    *
;* moveit 3.0 patch for atari 520 st  via modem port                *
;* patch space 0100h - 02ffh	all registers may be used	    *
;* use @ patmov submit command for patching			    *
;*								    *
;********************************************************************


	.Z80
	ASEG
	ORG	0100H



INSTT	EQU	04H		;virtual input status register
OUTSTT	EQU	05H		;virtual output status register
INDAT	EQU	06H		;virtual input data register
OUTDAT	EQU	04H		;virtual output data register


MOVATA:	JP	0302H		;start of moveit program
	JP	4000H		;end of user section
	JP	INILIN		;initialize communication line
	JP	DEINIL		;de-initialize communication line
	JP	RXSTAT		;comline input status
	JP	RXDATA		;comline data input
	JP	TXSTAT		;comline output status
	JP	TXDATA		;comline output data
	JP	SIGNON		;pointer to configuration message
	JP	DIAL		;auto dial/answer support



;user configuration message

SIGNON: DB	 09H, 09H, ' Atari 520 ST under SoftDesign CPMZ80 Emulator'
	DB	 0DH, 0AH, 0AH, '$'



;initialize communication line
;no entry or return parameters

INILIN:	CALL	RXSTAT		;delete
	OR	A		;all characters
	JR	Z,INIXIT	;in 
	CALL	RXDATA		;serial
	JR	INILIN		;input queue.

INIXIT:	RET



;de-initialize communication line
;no entry or return parameters

DEINIL: RET



;communication line input status
;return status in <a> = ff if character ready, 00 if not

RXSTAT: IN	A,(INSTT)
	RET



;communication line data input
;return input character in <a>

RXDATA: IN	A,(INDAT)
	RET



;communication line output status
;output character in <a> on entry

TXSTAT:	IN	A,(OUTSTT)
	RET



;communication line data output
;output character in <a> on entry
;<a> must remain unchanged !

TXDATA: OUT	(OUTDAT),A
	RET



;auto dial/answer support
;if <b>=0 on entry, dial the dialing string pointed to by <hl>
;if <b>=1 on entry, hang up
;if <b>=2 on entry, auto answer

DIAL:	RET


FILLER:	DS	MOVATA+0200H-$


	END
