/* 
	foo.c

	Copyright (C) 1992 Markus M. Nick

	---------------------------------------------------------------

	This program is distributed in the hope that it will be useful, 
	but WITHOUT ANY WARRANTY; without even the implied warranty of 
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
	documentation `docs\ruby.tex' for more details.

	---------------------------------------------------------------

	some dummy functions needed by Ruby running under Megamax LaserC
*/

void _dbuginit() { }

/* other stuff */

extern void save_regs();
extern int restore_regs();

extern long _lmul(), _lmpy();

long save_area[16*20];
long *sav_ptr = save_area + 16*20;
long sav_A0;

asm{
save_regs:
	move.l	A0, sav_A0
	move.l	sav_ptr, A0
	movem.l	D1-D7/A1-A6, -(A0)
	move.l	sav_A0, -(A0)
	move.l	A0, sav_ptr
	move.l	sav_A0, A0
	rts

restore_regs:
	move	4(A7), D0
	move.l	sav_ptr, A0
	move.l	(A0)+, sav_A0
	movem.l	(A0)+, D1-D7/A1-A6
	move.l	A0, sav_ptr
	move.l	sav_A0, A0
	rts	
	
; __lmpy setzt long-Multiplikation von PureC nach LaserC um
; in: D0.L, D1.L   out: D0.L
_lmpy:
	move.l	D1, -(A7)
	move.l	D0, -(A7)
	jsr		_lmul
	move.l	(A7)+, D0			; hier fehlt kein addq #xx,sp !!
	rts
}



/* -eof- */
