include	clib.inc
include	math.inc

	public	MUL32	; DX:AX * CX:BX

_TEXT	SEGMENT

MUL32	PROC	DIST
	PUSH	SI
	PUSH	DI
	PUSH	BP
	PUSH	AX
	PUSH	DX
	PUSH	DX
	MUL	BX	; 1L * 2L
	MOV	SI,DX
	MOV	DI,AX
	POP	AX
	MUL	CX	; 1H * 2H
	MOV	BP,DX
	XCHG	BX,AX
	POP	DX
	MUL	DX	; 1H * 2L
	ADD	SI,AX
	ADC	BX,DX
	POP	AX
	MUL	CX	; 1L * 2H
	ADD	SI,AX
	ADC	BX,DX
	ADC	BP,0
	MOV	CX,BP
	MOV	DX,SI
	MOV	AX,DI
	POP	BP
	POP	DI
	POP	SI
	RET	; CX:BX:DX:AX
MUL32	ENDP

_TEXT	ENDS

	END
