/* $Header:lofp.s 12.0$ */
/* $ACIS:lofp.s 12.0$ */
/* $Source: /ibm/acis/usr/sys/ca/RCS/lofp.s,v $ */

#ifndef fpget
	.data
#if !defined(NO_RCS_HDRS)
rcsidlofp:	.asciz	"$Header:lofp.s 12.0$"
#endif
	.text
#endif fpget

/*
 * 5799-WZQ (C) COPYRIGHT IBM CORPORATION  1986,1988
 * LICENSED MATERIALS - PROPERTY OF IBM
 * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
 */
	.globl	fpget
	.globl	fpput
	.text
	.align	2;
 # transfer control to the floating pointer emulator
 # control is transfered here via a 'bali r15,fpget' or
 # a 'bali r15,fpput' which the compiler generated
 # as a '.long FPaGET0' or '.long FPaPUT0'. This is
 # defined here as a bala to an invalid address (NFL_ADDR)
 # plus the offset to fpget or fpput.
 #
 # note that when we call the emulator we don't tell it
 # whether we were doing a load or a store - it uses
 # the relevent address to determine what to do.
 #
fpget:	
	jnop	0f			# use different addresses 
0:
fpput:
	cas	r2,r2,r0		# for debugger
	st	r3,-8(sp)		# save regs across call
	st	r4,-12(sp)		# save regs across call
	st	r15,-4(sp)		# save regs across call
	cal	sp,-100(sp)		# move stack pointer
	get	r0,$__FPemulate		# get data pointer
	balix	r15,_._FPemulate
	 st	r5,100-16(sp)		# save regs across call
	cal	sp,100(sp)		# replace stack pointer
	l	r15,-4(sp)		# restore regs after call
	l	r3,-8(sp)		# restore regs after call
	l	r4,-12(sp)		# restore regs after call
	brx	r15			# return
	 l	r5,-16(sp)		# restore regs after call

#ifndef fpget
.globl FPaGET0
.set FPaGET0, fpget-real0 + NFL_INSTN
.globl FPaPUT0
.set FPaPUT0, fpput-real0 + NFL_INSTN
#endif fpget
