Page 4 of 4

Re: Let's calculate! - renewed arithmetic routines

Posted: Thu Jun 28, 2018 7:46 pm
by zsolt
Hi,

Here come the latest bug fixes. Olofsen sent a newer program, wich tests the functions using very big and very small numbers.
l.p
olofsen's limits tester
(2.12 KiB) Downloaded 128 times
There were problems, with the renewed cosine function and the new INT routine was also buggy (in case of negative integer numbers).
Surprisingly i found a little bug in the SQR routine :o which is there since debut of SG81 ROM:

Code: Select all

;
;   This guess is based on a Usenet discussion.
;   Halve the exponent to achieve a good guess.(accurate with .25 16 64 etc.)
;
;;-	LD HL,$4071		; Address first byte of mem-3		($4071 points mem-4!!!)

	ld hl,$406C		; Address first byte of mem-3
Due to that wrong address the routine was very slow, in case of very big and very small numbers:
speedtest.png

@Siggi: the function-labels have been renamed - they now start with an "fn_" prefix. ;)

Regards,
Zsolt

Re: Let's calculate! - renewed arithmetic routines

Posted: Fri Jul 27, 2018 1:22 pm
by stefano
I posted a couple of years ago the Lambda 8300 disassembly, you may have noticed that it reorganized the FP-CALC opcodes to handle the END instruction as a sort of "status" bit together with some of the provided functions. It was probably used to obfuscate the code (to avoid copyright problems) and to compress it a little more.

Re: Let's calculate! - renewed arithmetic routines

Posted: Fri Jul 27, 2018 7:13 pm
by zsolt
Hi Stefano,
Yes, i know your great work, and the 2nd post of this topic begins with you. :D (and there were some links as well) ;)
Regards,
Zsolt

Re: Let's calculate! - renewed arithmetic routines

Posted: Mon Jul 30, 2018 1:20 pm
by stefano
oops.. :)