
	include	'exec/types.i'

setup	macro
	movem.l	d2/d3/d4-d7/a2-a6,-(sp)
	jsr	_geta4							;set up a4 for small model
	endm

push	macro
	move.l	\1,-(sp)
	endm

fix	macro
	ifc	'\1',''
		mexit
	endc
	ifle	\1-8
		addq.l	#\1,sp
	endc
	ifgt	\1-8
		lea	\1(sp),sp
	endc
	endm

restore	macro
	fix	\1
	movem.l	(sp)+,d2/d3/d4-d7/a2-a6	
	rts
	endm

	dseg

	public	_libfunctab
_libfunctab:
	dc.l	myopen
	dc.l	myclose
	dc.l	myexpunge
	dc.l	$0000
	dc.l	getdown
	dc.l	double
	dc.l	$ffffffff

	cseg

	;--- library functions
	public	_myOpen
	public	_myClose
	public	_myExpunge
	public	_GetDown
	public	_Double

	;--- interface routines
	;public	myopen
	;public	myclose
	;public	myexpunge
	;public	getdown
	;public	double

	public	_geta4

myopen:
	setup
	push a6
	jsr	_myOpen
	restore	4

myclose:
	setup
	push a6
	jsr	_myClose
	restore 4

myexpunge:
	setup
	push a6
	jsr	_myExpunge
	restore 4

getdown:
	setup
	jsr	_GetDown
	restore

double:
	setup
	push d0
	jsr _Double
	restore 4

	end
