	INCLUDE 'exec/types.i'
	INCLUDE 'exec/nodes.i'
	INCLUDE 'exec/libraries.i'

	LIBINIT
	LIBDEF	_LVOSendText
	LIBDEF	_LVORequestNumber
	LIBDEF	_LVORequestString

	; Note: the Aztec assembler does not get along with
	; the SECTION definitions. To assemble this module
	; with any other assembler replace DSEG/CSEG by
	; the keyword following the semicolon.

	DSEG	; SECTION DATA

SafeKeep:
	DS.L	14

	CSEG	; SECTION CODE

	; --- xref from application

	XREF	_FarBase

	; --- xdef for application

	XDEF	_SendText
	XDEF	_RequestNumber
	XDEF	_RequestString

	; Sorry, the text formatting routine did not
	; move to the library. I had too many crashes trying
	; to implement it, so you'll find it below in the
	; library glue routines.

_SendText:
	MOVEM.L	D2-D7/A2-A5,SafeKeep

	LINK	A5,#-512
	MOVEM.L	D1/A0-A3,-(SP)

	MOVEA.L	8(A5),A0
	LEA	12(A5),A1
	LEA	kput1(PC),A2
	LEA	-512(A5),A3
	MOVE.L	4,A6
	JSR	$FFFFFDF6(A6)
	
	LEA	-512(A5),A0

	MOVE.L	A5,-(SP)
	MOVE.L	A0,-(SP)

	MOVE.L	_FarBase,A6
	JSR	_LVOSendText(A6)

	ADD.W	#4,SP
	MOVE.L	(SP)+,A5

	MOVEM.L	(SP)+,D1/A0-A3
	UNLK	A5

	MOVEM.L	SafeKeep,D2-D7/A2-A5
	RTS

kput1:	MOVE.B	D0,(A3)+
	RTS

_RequestNumber:
	MOVE.L	4(SP),A0
	MOVE.L	_FarBase,A6
	JMP	_LVORequestNumber(A6)

_RequestString:
	MOVE.L	4(SP),A0
	MOVE.L	8(SP),A1
	MOVE.L	_FarBase,A6
	JMP	_LVORequestString(A6)

	END
