Tableau de comparaison des mots clefs en BASIC

Ici, on fait dans le petit, le LCD qui déchire sa race, on y cause même calculatrices quand on est en manque !

Modérateur : Politburo

Répondre
ynopum
Fonctionne à 75 bauds
Fonctionne à 75 bauds
Messages : 6
Enregistré le : 03 mai 2009 12:36
Localisation : Bulgarie

Message par ynopum »

Xerxes a écrit :...
The differences between MODE10/11 are not obvious sometimes:

The evaluation of "1/23" gives 0.04347826087 but "FRAC(1/23*1E3)" gives
MODE10: 0.47826087
MODE11: 0.4782608695

This is the reason for the higher accuracy of the Frolov test using MODE11.
...
I think I got it!
Shortly: MODE11 prevents the CASIO for "cheating" and trying to round-down to display "nice round integers". MODE10 (or switch on/off) resets the unit to "integer cheating".
Don't blame me for using such terminology, here is what I saw yesterday trying to figure out the meaning of these hidden modes:
http://spiderpixel.co.uk/caspro/subhtml/casf1.html

And just for the test as explained on the above page:
123456789 + .008 - 123456789 -> Mode10: 0.008 mode11: 0.008
123456789 + .007 - 123456789 -> Mode10: 0 mode11: 0.007
... ... for .006 to .001 the default MODE 10 truncates attempting to show "nice integer", and the MODE11 gives the fair result.

I will quote John Meyers:
Here's the scoop: Every time this type of Casio calculates a numeric result,
it looks at the last three digits of the internal "mantissa" (the significant
digits of the truncated result); if these digits are anywhere in the range
001 thru 007, your Casio just lops off these digits, presuming that the
"correct" result *should* have ended with 000; similarly, if the last
three mantissa digits of the truncated result are in the range 993-999,
your helpful FUDGING Casio "fixes up" that result for you by
ROUNDING IT UP until its last three digits are 000 !!!
So this is the meaning of MODE10/11: turning of this truncation. That is why it gives better result for Frolov's test, because the truncation is mostly one direction - down. The cumulative error for the default MODE10 can be significant, but the error of the full mantissa of MODE11 may compensate this accumulation, because in is in the both directions.
MODE10: 674475.396
MODE11: 674512.576
Correct : 674530.471

Finally, it is not fair from CASIO not to document this feature and the option to control it. Improperly made algorithm where summation occurs may lead to significant final accumulated error.
Casio FX-795P; fx-4500PA; fx-5500LA; fx-6300G; fx-9860G; TI-92Plus
Avatar du membre
Marcus von Cube
Fonctionne à 1200 bauds
Fonctionne à 1200 bauds
Messages : 914
Enregistré le : 20 avr. 2006 13:48
Localisation : Wehrheim, Allemagne
Contact :

Message par Marcus von Cube »

Does anybody know which Casio models support MODEs 10&11? It might have something to do with matrix calculations which require the highest precision possible to solve "almost" singlular problems. This has been discussed at length in the HP forum. You might need to search the archives.
ynopum
Fonctionne à 75 bauds
Fonctionne à 75 bauds
Messages : 6
Enregistré le : 03 mai 2009 12:36
Localisation : Bulgarie

Message par ynopum »

I asked a colleague to test MODE11 on his fx-730P, and he said no Error was returned by the computer. I assume that it works on the whole fx-730 generation.

_________________________

I am now very curious about MODE22|23|24|25.
Casio FX-795P; fx-4500PA; fx-5500LA; fx-6300G; fx-9860G; TI-92Plus
Avatar du membre
Xerxes
Fonctionne à 300 bauds
Fonctionne à 300 bauds
Messages : 292
Enregistré le : 02 avr. 2007 13:41
Localisation : Allemagne
Contact :

Message par Xerxes »

Marcus von Cube a écrit :Does anybody know which Casio models support MODEs 10&11?
In addition to the FX-730P series, they are also available on the FX-880P, VX-4 and Z-1GR.
Avatar du membre
zpalm
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 2917
Enregistré le : 03 mai 2008 15:33
Localisation : Grenoble

Message par zpalm »

Hi Marcus,

You may be interested by the Sharp PC-1403 entry points for matrix operations that can't be included in BASIC programs normally. They have been published on the hpmuseum forum:

http://www.hpmuseum.org/cgi-sys/cgiwrap ... 792#111281
Re: Sharp Calculators: PC-1403 in particular
Message #45 Posted by HrastProgrammer on 31 Mar 2007, 5:23 a.m.,
in response to message #43 by Valentin Albillo

Hi Valentin and Gene,

Sharp threads are always interesting to me because I was involved into Sharps very much, long time ago ...

It is true that matrix operations are not accessible from BASIC using BASIC commands and functions but this doesn't mean that they aren't accessible at all :-)

I remember hacking PC-1403 some 20 years ago. I disassembled and analyzed large portions of its ROM (PC-1403 has 8K of ROM built-into CPU and 64K of bank-switched ROM in 4x16K banks). Between many other things, I found all matrix operations addresses in ROM. Fortunatelly, they are all located in ROM4 which is active by default when executing CALL so calling them from BASIC was possible without any trouble.

For example, suppose that you want to solve the following system of linear equations from the PC-1403 users manual (page 77):

2x + 5y - z = -1
x - y + 4z = 12
3x + 2y + z = 9

The following program can do this without even blinking:

5 "A": CLEAR: RESTORE 20
10 DIM X(2,2): FOR I=0 TO 2: FOR J=0 TO 2: READ X(I,J): NEXT J: NEXT I
20 DATA 2,5,-1,1,-1,4,3,2,1
30 DIM Y(2,0): FOR I=0 TO 2: READ Y(I,0): NEXT I
40 DATA -1,12,9
50 CALL 26132: REM invX->X
60 CALL 26119: REM X*Y->X
70 FOR I=0 TO 2: PRINT X(I,0): NEXT I

Type DEF A and after less than 2 seconds this program will start printing the results: 3, -1 and 2 ... The results are saved into X because PC-1403 used regular X, Y and M variables to work with matrices.

Best regards.
HrastProgrammer
http://www.hpmuseum.org/cgi-sys/cgiwrap ... 792#111389
Here is the list of PC-1403 ROM matrix subroutines I found:

26109 X+Y->X
26114 X-Y->X
26119 X*Y->X
26124 X*invY->X
26132 invX->X
26140 (x)+X->X
26148 (x)-X->X
26153 (x)*X->X
26158 (x)*invX->X
26163 X<>Y
26171 trnX->X
26176 detX->(x)
26181 -X->X
26186 squX->X
26191 X->M
26199 M->X
26204 X+M->X

X, Y and M are matrices (DIMensioned 2-dimensional BASIC arrays) while (x) is the simple BASIC variable X. For example, X=10: CALL 26153 will multiply matrix X with a scalar value 10 and CALL 26176: PRINT X will print the determinant of matrix X. Using the above subroutines I was able to squeeze really big programs dealing with matrices into the limited PC-1403 memory (some 6878 bytes after reset).

But, please, don't take for granted that these addresses will work in all PC-1403s because of various ROM revisions or because I maybe retyped some of them incorrectly
...
Avatar du membre
Marcus von Cube
Fonctionne à 1200 bauds
Fonctionne à 1200 bauds
Messages : 914
Enregistré le : 20 avr. 2006 13:48
Localisation : Wehrheim, Allemagne
Contact :

Message par Marcus von Cube »

Thanks for the interestring read. It's time to go back to the sheet and make some additions.
Avatar du membre
zpalm
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 2917
Enregistré le : 03 mai 2008 15:33
Localisation : Grenoble

Re: Tableau de comparaison des mots clefs en BASIC

Message par zpalm »

Marcus,

J’ai l’impression qu’il y a une erreur dans ton tableau pour l’instruction Position cursor page 32 :
CURSOR n’est pas supporté sur les PC-140x ni sur PC-1245.
Autre question : dans quelle colonne classes-tu le PC-1251 ?
Avatar du membre
charognard
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4412
Enregistré le : 06 juin 2007 19:28
Localisation : Indre et loire
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par charognard »

zpalm a écrit :Marcus,

J’ai l’impression qu’il y a une erreur dans ton tableau pour l’instruction Position cursor page 32 :
CURSOR n’est pas supporté sur les PC-140x ni sur PC-1245.
Autre question : dans quelle colonne classes-tu le PC-1251 ?
effectivement.

le 1245 est un 1251 avec moins de mémoire, un écran de 16 caractères et pas de mode réserve
Avatar du membre
Marcus von Cube
Fonctionne à 1200 bauds
Fonctionne à 1200 bauds
Messages : 914
Enregistré le : 20 avr. 2006 13:48
Localisation : Wehrheim, Allemagne
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par Marcus von Cube »

Merci pour les corrections. J'ai remplacé les fichiers en ligne.
Avatar du membre
charognard
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4412
Enregistré le : 06 juin 2007 19:28
Localisation : Indre et loire
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par charognard »

le PDF est pas correct !!
erreur :
l'instruction CALL est sans paramètres sur au moins les PC 1245, 125x, 126*, 140x, 13xx et PC-G850 et c'est bien dommage !!
Avatar du membre
pir2
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4641
Enregistré le : 31 oct. 2006 15:08
Localisation : 67310 Westhoffen
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par pir2 »

charognard a écrit :le PDF est pas correct !!
erreur :
l'instruction CALL est sans paramètres sur au moins les PC 1245, 125x, 126*, 140x, 13xx et PC-G850 et c'est bien dommage !!
Ben ouais, faut poker avant. Ah, les limitations du Basic ...
Image
Image
Avatar du membre
charognard
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4412
Enregistré le : 06 juin 2007 19:28
Localisation : Indre et loire
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par charognard »

pir2 a écrit :
charognard a écrit :le PDF est pas correct !!
erreur :
l'instruction CALL est sans paramètres sur au moins les PC 1245, 125x, 126*, 140x, 13xx et PC-G850 et c'est bien dommage !!
Ben ouais, faut poker avant. Ah, les limitations du Basic ...
il y a un paramètre sur le 1500, 1600 et en C sur 850V
Avatar du membre
pir2
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4641
Enregistré le : 31 oct. 2006 15:08
Localisation : 67310 Westhoffen
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par pir2 »

Bon, j'ai rien dit alors (mais en terme de CALL, je ne connais que mon VIC-20 et mes petits sharps :? )
Image
Image
Avatar du membre
charognard
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4412
Enregistré le : 06 juin 2007 19:28
Localisation : Indre et loire
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par charognard »

pir2 a écrit :Bon, j'ai rien dit alors (mais en terme de CALL, je ne connais que mon VIC-20 et mes petits sharps :? )
Pourtant le 1500, 1600 et G850V sont bien des Sharp :wink:
dans mon INKEY en C j'utilise bien le CALL avec passage de paramètres

de plus dans un code que j'ai publié dernièrement
j'utilise cette fonctionnalité
ça sert à quoi que je me fasse chier !!! :lol:
j'appelle la routine en AD et je reçois en B sur SHARP PC 1500

Code : Tout sélectionner

5 WAIT 0
10 AD=&4600
20 POKE AD,&BE,&E2,&43,&B7,0,&9B,7,&48,0,&A,&FB,&9A
30 CALL AD,B
40 PRINT B
50 GOTO 30
routine relogeable bien sur

Code : Tout sélectionner

BEE243 CALL E243
B700   CPI A,0
9B07   BHS-7
4800   LDI Xh
0A     STA Xl
FB     SEC
9A     RTN
Avatar du membre
pir2
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4641
Enregistré le : 31 oct. 2006 15:08
Localisation : 67310 Westhoffen
Contact :

Re: Tableau de comparaison des mots clefs en BASIC

Message par pir2 »

J'avais dit "petits" Sharps, donc 1251 / 1262 ;)

C'est le jour du n'œuf qui m'a perturbé.
Image
Image
Répondre

Retourner vers « Tous les Pockets »