Let's calculate!  renewed arithmetic routines
Re: Let's calculate!  renewed arithmetic routines
Great progress
Just testet LOAD "Memocalc" and it worked
Now it seems to be possible to LOAD programs also by a running program (not only by the user, pressing DSL).
Currently I cannot LOAD/SAVE Memocalc data files (which are loaded/saved by Memocalc by the command "LOAD A$(L TO C)"(*), which is embedded in M/C and called from M/C!) on ZxMore, because patching Memocalc to call (on LOAD and SAVE) an external program, which asked and waited for the user's DSL or DSS to be done, resulted in finishing Memocalc and return to BASIC (despite this technology workes well when using MEFISDOS/MMC as mass storage device).
More tests will follow ....
Siggi
Edit: (*): the ROM subroutine "03A8 NAME" can be used scan/evaluate such a complex string ....
Just testet LOAD "Memocalc" and it worked
Now it seems to be possible to LOAD programs also by a running program (not only by the user, pressing DSL).
Currently I cannot LOAD/SAVE Memocalc data files (which are loaded/saved by Memocalc by the command "LOAD A$(L TO C)"(*), which is embedded in M/C and called from M/C!) on ZxMore, because patching Memocalc to call (on LOAD and SAVE) an external program, which asked and waited for the user's DSL or DSS to be done, resulted in finishing Memocalc and return to BASIC (despite this technology workes well when using MEFISDOS/MMC as mass storage device).
More tests will follow ....
Siggi
Edit: (*): the ROM subroutine "03A8 NAME" can be used scan/evaluate such a complex string ....
My ZX81 webserver: online since 2007
http://zx81siggi.endoftheinternet.org/index.html
http://zx81siggi.endoftheinternet.org/index.html
Re: Let's calculate!  renewed arithmetic routines
I just testet Memocalc without my SAVE/LOAD patches. Now it can save/load data files using its internal "LOAD A$(L TO C)"
But the filename is a little bit strange: I saved "mtest", and Windows sees a file with invalid filename it cannot handle: "mtest<<<.<<<" (where "<" is one chacter: an arrow to the left). Thus 3 chars before the '.' and 3 chars past the '.' are "<" (maybe not initialized by Memocalc).
But ZxMore can handle that file, so I now can save/load Memocalc data files
@ZSOLT: I have made tests with Memocalc and let it do:
sum=0
FOR degree=365 down to 0
sum=sum+sin(degree/180*PI)^2+cos(degree/180*PI)^2
next degree
and got the expected result. Since Memocalc does call a lot of BASIC functions to handle the "grid", to edit and calculate the field contents (e.g. by using the BASIC input line editor to input eqations containing BASIC keywords/functions) and there was no problem:
Siggi
But the filename is a little bit strange: I saved "mtest", and Windows sees a file with invalid filename it cannot handle: "mtest<<<.<<<" (where "<" is one chacter: an arrow to the left). Thus 3 chars before the '.' and 3 chars past the '.' are "<" (maybe not initialized by Memocalc).
But ZxMore can handle that file, so I now can save/load Memocalc data files
@ZSOLT: I have made tests with Memocalc and let it do:
sum=0
FOR degree=365 down to 0
sum=sum+sin(degree/180*PI)^2+cos(degree/180*PI)^2
next degree
and got the expected result. Since Memocalc does call a lot of BASIC functions to handle the "grid", to edit and calculate the field contents (e.g. by using the BASIC input line editor to input eqations containing BASIC keywords/functions) and there was no problem:
Siggi
My ZX81 webserver: online since 2007
http://zx81siggi.endoftheinternet.org/index.html
http://zx81siggi.endoftheinternet.org/index.html
Re: Let's calculate!  renewed arithmetic routines
Yes, I left it in place at the beginning of LOAD and SAVE. However, the resulting string can only have AZ. That is because the ZX81 character to ASCII conversion just adds $1B, otherwise it takes too much space
Re: Let's calculate!  renewed arithmetic routines
Great Newssiggi wrote: ↑Thu Jun 14, 2018 9:37 pmand got the expected result. Since Memocalc does call a lot of BASIC functions to handle the "grid", to edit and calculate the field contents (e.g. by using the BASIC input line editor to input eqations containing BASIC keywords/functions) and there was no problem
Thanks,
Zsolt
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
Re: Let's calculate!  renewed arithmetic routines
Many thanks to olofsen:
At the beginning of the normalization, the counter had a bad starting value:
You can find Erik's test program and the bug fixed ROM image in the attachment.
The "SG81_Gm" is for ZXmore (wo. 3Tpatch), which is ~3% slower than the other.
Regards,
Zsolt
I found the BUG This is a "small mistake", but it is very important that we found it.olofsen wrote:I reread your posts and saw your note on "testing the limits", and got the idea of finding FLT_EPSILON.
It is the smallest number that when added to 1, the result is different from 1.
In the attached program, I'm on my way to compute it. Line 2000 makes V, at first 1, greater than 1.
If you run this program with the original ZX81 ROM, V1 is printed as 4.6566129E10. However, with your ROM, it prints 0...
At the beginning of the normalization, the counter had a bad starting value:
Code: Select all
ld bc,$2000 ; set counters (it was $1F00)
ld a,c ; clear A
rra ; A7 indicates the sign change
sub_norm
bit 7,h ; normalize
jp nz,sub_end ; done if msb=1
ex de,hl ;
add hl,hl ; double the lower word of the result's mantissa
ex de,hl ;
adc hl,hl ; double the upper word of the result's mantissa
inc c ; set counter
djnz sub_norm ; max. 31 shifts are accepted
The "SG81_Gm" is for ZXmore (wo. 3Tpatch), which is ~3% slower than the other.
Regards,
Zsolt
 Attachments

 SG81_G1.zip
 contains the bug fix
 (81.63 KiB) Downloaded 7 times
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
Re: Let's calculate!  renewed arithmetic routines
Hi ZSOLT
I tried to assemble your source using Pokemon's IDE (using FASMWZX.EXE) and the assembler used in Z88DK. But none of them can handle the labels you are using, e. g.:
They accept only such labels:
or
Which assembler to you use? Is it availabe somewhere (I am using WIN as OS):
Siggi
I tried to assemble your source using Pokemon's IDE (using FASMWZX.EXE) and the assembler used in Z88DK. But none of them can handle the labels you are using, e. g.:
Code: Select all
not_1
NEG
Code: Select all
not_1:
NEG
or
Code: Select all
not_1 NEG
Which assembler to you use? Is it availabe somewhere (I am using WIN as OS):
Siggi
My ZX81 webserver: online since 2007
http://zx81siggi.endoftheinternet.org/index.html
http://zx81siggi.endoftheinternet.org/index.html
Re: Let's calculate!  renewed arithmetic routines
Hi Siggi,
I use the good old 'Assembly Studio 86 v3.1' (downloadable from here  ticalc.org/pub/win/asm/).
It has a good editor, a code counter (counts also the Tstates!) and it is TASM compatible.
But why not rename the labels to the desired format?
Regards,
Zsolt
I use the good old 'Assembly Studio 86 v3.1' (downloadable from here  ticalc.org/pub/win/asm/).
It has a good editor, a code counter (counts also the Tstates!) and it is TASM compatible.
But why not rename the labels to the desired format?
Regards,
Zsolt
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
Re: Let's calculate!  renewed arithmetic routines
Hi ZSOLT
If your current rom is the final version, that would be OK. But if not, it must be done with each new version
I want to do some more patches I have in my own roms to support my own hardware better (LOAD/SAVE using MMC/Mefisdos, bank switching@8k, printer driver in RAM instead of ROM, Euro character instead of pound sign, ....)
Siggi
My ZX81 webserver: online since 2007
http://zx81siggi.endoftheinternet.org/index.html
http://zx81siggi.endoftheinternet.org/index.html