GPU	set 1
	path "e:\js\"
	include "macro\help.mac"

dummy	reg 0

op1	REG 10
op1.nk	reg 11
op2	REG 12
op2.nk	reg 13
sign	reg 14
help1	reg 15
help2	reg 16


	MACRO fpsub
	sub \0.nk,\1.nk
	subc \0,\1
	endm

	macro fpadd
	add \0.nk,\1.nk
	addc \0,\1
	endm

	macro fpmult
	move \0,sign
	xor \1,sign
	abs \0
	abs \1
	abs \0.nk
	abs \1.nk
	shrq #16,\0.nk
	shrq #16,\1.nk
	move \0.nk,help1
	mult \1,help1		; help1 = vk2*nk1
	move \1.nk,help2
	mult \0,help2		; help2 = vk1*nk2
	mult \0.nk,\1.nk	; nk2   = nk1*nk2
	add help2,help1
	move help1,help2
	mult \0,\1
	shlq #16,help1
	shrq #16,help2
	add help1,\1.nk
	addc help2,\1
	btst #31,sign
	jr nz,.\fpcont
	nop
		neg \1
		neg \1.nk
.\fpcont
	endm
	
	run $f03000
	jr .cont
	nop
	dc.l -10,-$8000<<16
	dc.l 10,$8000<<16
	

.cont	movei #$f03004,r14
	load (r14),op1
	load (r14+4),op1.nk
	load (r14+8),op2
	load (r14+12),op2.nk
		

	fpmult op1,op2

	STOP_GPU
	nop
	
	
