	title	Module from library HIFLOAT_2 : LBOP2
	name	('LBOP2')
	maclib	baselib.lib

; Interface the stack oriented routines to address
; referrenced calls

; Copyright (C)	Werner Cirsovius
;		Hohe Weide 44
;		D-20253 Hamburg
;		Tel.: +49-40-4223247

;		Version 1.0 January 1989

; ENTRY	Reg pair BC points to first number, pair DE points to
;	second number and reg pair HL points to result
;	Reg IX holds two operand routine address

; EXIT	Result filled with requested operation
;	Carry set on math error

	entry	@oper2

	ext	flperr

@oper2:
	ld	(LINK+1),ix	; Set routine
	push	hl		; Save result pointer
	push	bc
	push	de
	pop	ix
	pop	iy
	ld	h,(iy+0)
	ld	l,(iy+1)
	push	hl		; Save 1st number onto stack
	ld	l,(iy+2)
	ld	h,(iy+3)
	push	hl
	ld	h,(ix+0)	; Load 2nd number
	ld	l,(ix+1)
	ld	e,(ix+2)
	ld	d,(ix+3)
LINK:
	call	$-$		; Execute routine
	pop	ix
	ld	(ix+0),h	; Save result
	ld	(ix+1),l
	ld	(ix+2),e
	ld	(ix+3),d
	ld	a,(flperr)	; Get error
	rra
	ret

	end

