File:  [MW Coherent from dump] / coherent / b / lib / libc / crt / i8086 / dfxmu.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

////////
/
/ Intel 8086 floating point.
/ assigned multiply to a single float.
/ small model.
/
////////

	.globl	dflmul
	.globl	dfrmul
	.globl	_fpac_
	.globl	dlmul

////////
/
/ ** dflmul -- assigned single multiply (lvalue)
/ ** dfrmul -- assigned single multiply (rvalue)
/
/ these two routines are called directly by the compiler to do single
/ floating assigned multiply. these small routines make the  compiler
/ simpler, and get rid of a very bulky code sequence that would  have
/ to be generated for a fairly uncommon operation.
/
/ compiler calling sequences:
/	push	<right single rvalue>
/	lea	ax,<left single lvalue>
/	push	ax
/	call	dfrmul
/	add	sp,10
/
/	lea	ax,<right single lvalue>
/	push	ax
/	lea	ax,<left single lvalue>
/	push	ax
/	call	dflmul
/	add	sp,4
/
/ outputs:
/	_fpac_=result.
/
/ uses:
/	ax, bx, cx, dx
/
////////

pa	=	8			/ pointer to left
pb	=	10			/ pointer to right
b	=	10			/ right

dflmul:	push	si			/ standard
	push	di			/ c
	push	bp			/ function
	mov	bp,sp			/ entry

	mov	ax,pb(bp)		/ ax=pointer to right operand
	jmp	l0			/ finish in common code

dfrmul:	push	si			/ standard
	push	di			/ c
	push	bp			/ function
	mov	bp,sp			/ entry

	lea	ax,b(bp)		/ ax=pointer to right operand

l0:	push	ax			/ second arg is right lvalue.
	mov	si,pa(bp)		/ si=pointer to left.
	push	2(si)			/ push
	push	0(si)			/ the
	sub	ax,ax			/ double
	push	ax			/ left
	push	ax			/ rvalue
	call	dlmul			/ do the addition.
	add	sp,$10			/ pop args

	mov	ax,_fpac_+6		/ copy
	mov	2(si),ax		/ the
	mov	ax,_fpac_+4		/ result
	mov	0(si),ax		/ back

	pop	bp			/ standard
	pop	di			/ c
	pop	si			/ function
	ret				/ return.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.