cze , pisze program w asemblerze a dokladnie PCSpimie pt mnozenie liczb w formacie 64 bitowym (IEEE, nie uzywajac FP a tylko CP ) i moje proby spelzaja na niczym , dla jednych liczb dziala dla drugich nie , moze ktos ( no niech sie ktos taki znajdzie :)) powie mi co tu jest zle :
.data
title: .asciiz "\n\nFLOATING POINT MULTIPLICATION PROGRAM\n\n"
prm1: .asciiz "Enter the first float:\n"
prm2: .asciiz "Enter the second float:\n"
fin1: .asciiz "\nThe result from FPU:\n"
fin2: .asciiz "\nThe result from CPU loaded to FPU:\n"
arg1: .space 32
arg2: .space 32

.text

main :
li $v0,4 #title
la $a0,title
syscall

li $v0,4		#prompting fot the fist argument
la $a0,prm1
syscall

li $v0,7		#reading the first argument to FPU
syscall
mov.d $f2,$f0		#first argument in $f2 !!!

li $v0,4		#prompting for the second argument
la $a0,prm2
syscall

li $v0,7		#reading the second argument to FPU
syscall
mov.d $f4,$f0		#second argument in $f4 !!!

OPERATIONS IN FPU

mul.d $f6,$f2,$f4	#multypling arguments in FPU using built-in function

li $v0,4		#printing the result
la $a0,fin1
syscall

li $v0,3		#printing the result
mov.d $f12,$f6
syscall

OPERATIONS IN CPU

#storing float agruments in CPU registers

mfc1 $t0,$f3		#first argument in $t0
mfc1 $s4,$f2
mfc1 $s5,$f4
and $t1,$t0,2147483648

and $t2,$t0,2146435072	#(E1)exponent in $t2

and $t3,$t0,1048575	#(M1)mantissa in $t3

mfc1 $t4,$f5		#second argument in $t4

and $t5,$t4,2147483648	#(S2)sign in $t5

and $t6,$t4,2146435072	#(E2)exponent in $t6

and $t7,$t4,1048575	#(M2)mantissa in $t7

xor $s1,$t1,$t5		#(S3)sign in $s1

addu $s0,$t2,$t6
addu $s2,$s0,1074790400	#(E3)exponent in $s2
move $t1,$0
move $t5,$0
move $t2,$0
move $t6,$0

#mnozenie mantys

addu $t3,$t3,1048576
addu $t7,$t7,1048567
addiu $t5,$t5,53

mnoz1:

blez $t5, koniec
and $s3,$s5,1
beq $s3,1,dod1
srl $s4,$s4,1
srl $s5,$s5,1

mnoz2:

and $s6,$t7,1
and $s7,$t3,1

beq $s7,1,przenies

mnoz3:

beq $s6,1,dod2
srl $t3,$t3,1
srl $t7,$t7,1
sub $t5,1
j mnoz1

przenies :

addu $s4,$s4,2147483648
j mnoz3

dod2:

move $t1,$t3
srl $t3,$t3,1
addu $t3,$t3,$t1
sub $t5, 1
j mnoz1

dod1:

move $t2,$s4
srl $s4,$s4,1
addu $s4,$s4,$t2
srl $s5,$s5,1
j mnoz2

koniec:
#addu $s2,$s2,1
and $t2,$t3,1047552

or $s6,$s1,$s2		#S3 and E3 glued together in $s6
or $s7,$s6,$t2		#S3, E3 and M3 glued together in $s7

MOVING RESULT TO FPU AND PRINTING IT

mtc1 $s7,$f1		#result moved to float register $f6
mtc1 $t3,$f0


li $v0,4
la $a0,fin2
syscall	



li $v0,3
mov.s $f12,$f0
syscall

dzieki z gory