; Lovingly swiped from Eric Smith's mntlib.

	.globl	_gemdos
	.globl	_xbios
	.globl	_bios

	.text
	.even
_gemdos:
	lea	20(sp),a0	; 4 bytes for ret addr + 16 for parameters
	movem.l	d2/a2,-(sp)	; save reggies that TOS clobbers but that
				; C thinks functions should preserve
	move.l	-(a0),-(sp)	; max. of 16 bytes parameters to trap #1
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	trap	#1		; go do the trap
	lea	16(sp),sp	; pop parameters
	movem.l	(sp)+,d2/a2	; restore reggies
	rts			; return

_bios:
	lea	24(sp),a0
	movem.l	d2/a2,-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	trap	#13
	lea	20(sp),sp
	movem.l	(sp)+,d2/a2
	rts

_xbios:
	lea	32(sp),a0
	movem.l	d2/a2,-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	move.l	-(a0),-(sp)
	trap	#14
	lea	28(sp),sp
	movem.l	(sp)+,d2/a2
	rts
