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
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 »

Bon à savoir. :wink:
Avatar du membre
charognard
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4412
Enregistré le : 06 juin 2007 19:28
Localisation : Indre et loire
Contact :

Message par charognard »

Les operateurs booleens exitent sur 850/880, y a t'il pas une erreur dans ton tableau ?
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 »

Charo, je vais le rechercher.
jxano
Fonctionne à 2400 bauds
Fonctionne à 2400 bauds
Messages : 2362
Enregistré le : 16 févr. 2008 23:34
Localisation : Paris 20ème

Message par jxano »

charognard a écrit :Les operateurs booleens exitent sur 850/880, y a t'il pas une erreur dans ton tableau ?
Il y a bien de l'arithmétique booléenne, mais seulement avec 0 et -1 en résultat (-1 ! À chaque fois, je me fais avoir par le signe !) Pas de calcul sur 16 bits comme les Sharp...
Programmeur abscons.
Avatar du membre
charognard
Fonctionne à 9600 bauds
Fonctionne à 9600 bauds
Messages : 4412
Enregistré le : 06 juin 2007 19:28
Localisation : Indre et loire
Contact :

Message par charognard »

jxano a écrit :
charognard a écrit :Les operateurs booleens exitent sur 850/880, y a t'il pas une erreur dans ton tableau ?
Il y a bien de l'arithmétique booléenne, mais seulement avec 0 et -1 en résultat (-1 ! À chaque fois, je me fais avoir par le signe !) Pas de calcul sur 16 bits comme les Sharp...
pourtant si je frappe 14 OR 3 ça me retourne bien 15 sur le 880P !
jxano
Fonctionne à 2400 bauds
Fonctionne à 2400 bauds
Messages : 2362
Enregistré le : 16 févr. 2008 23:34
Localisation : Paris 20ème

Message par jxano »

charognard a écrit :pourtant si je frappe 14 OR 3 ça me retourne bien 15 sur le 880P !
Tu le connais mieux que moi... Je m'incline. Ça marche effectivement sur 16 bits (avec le signe) aussi !
Programmeur abscons.
ynopum
Fonctionne à 75 bauds
Fonctionne à 75 bauds
Messages : 6
Enregistré le : 03 mai 2009 12:36
Localisation : Bulgarie

Message par ynopum »

Xerxes a écrit :
Marcus von Cube a écrit :Sera-t-il possible d'analyser le logiciel préprogrammé d'un FX-795P ? Peut-on faire une liste?
Usually the 4-bit CASIO pockets have no external ROM. The complete firmware is
hidden in the internal CPU ROM but the FX-795P seems to be the exception.
Due to the limited internal ROM, an external ROM was added to hold a part of
the math library. In contrast to the FX-880P some math routines are coded in
assembly and not in BASIC only. This external ROM can be accessed by MODE18
(=PEEK).

Thanks to Piotr, the complete BASIC part of the FX-795P math library:

Code : Tout sélectionner

........
........
........
........
The used MODE commands are: 18,20,21,26,27,28,29,90,91,92,93,94,95,96,97,99
Excuse moi pour l'anglais!

After examining of the quoted program library, and also reading of the forum, and playing with my Casio, I tried to make a list of the undocumented MODE commands. Most of them were already known, but some are not.

My tests showed that the matrices sizes are not limited to 9x9 as in the FXLibrary. Successful operations were done with 15x15 size for matrix inversion. We should take in mind that for not well defined matrices the inversion can give unreliable results.

Also I did some speed tests for the matrix operations. The "internal" matrix commands work roughly 5~6 times faster than BASIC written routines doing the same job (of course a difference of the algorithm plays a major role maybe). This was tested with random filled matrices 5x5.
Also I tested the calculator fx-5500LA with such 5x5 random matrices. It seems it is about twice faster than fx-795P. It is pity it is not programmable, and the fx-4500PA is obviously much slower than 5500LA - I decided not to make tests on it.

So, here is the list for now:

MODE 10
Standard truncation of the last digits after calculation. This mode is reset after turn-off/on of the device. Produces round results for integers. (thanks to Xerxes)

MODE 11
No truncation of the last digits. This mode is canceled after turn-off/on of the device. Should be used if we suspect error accumulation in default mode. (more explanation on Page11 of the thread)

MODE18(A,B)
Gets from address A the HEX value as B$. The syntax is with brackets!

MODE19(A,B)
Puts in address A the value B. The syntax is with brackets!

MODE 20,A
Evaluates as expression the variable $ and puts the result in variable A

MODE 21,A,B
Waits for keypress and returns its character in A$ and its DEC code in B

MODE 22 unknown
MODE 23 unknown
MODE 24 unknown
MODE 25 unknown

MODE 26,A
Converts the value of $ variable (assumed to be a BIN number) to DEC variable A

MODE 27,A
Converts the value of $ variable (assumed to be a HEX number) to DEC variable A

MODE 28,A
Converts the value of variable A (DEC number) to LONG BIN string in variable $

MODE 29,A
Converts the value of variable A (DEC number) to SHORT BIN string in variable $

MODE 90,A,B,F
Matrix operation: inverse of matrix A goes to matrix B. Return code F is for success. If the value of F = 0 then the inversion operation was unsuccessful.

MODE 91,A,,D
Matrix operation: determinant of matrix A goes to variable D. Note the double comma! I tried to put variable there but an Error occurs.

MODE 92,A,B
Matrix operation: contents of matrix A goes to matrix B

MODE 93,A
Matrix operation: contents of matrix A is transposed

MODE 94,A,B,C
Matrix operation: matrix A multiplied by matrix B goes to C. C variable should not be an array. The command will create it as an array.

MODE 95,A
Equal to INPUT,A (used in the FXLibrary with error code reading from the memory)

MODE 96,Oper,A,B,C
Boolean operation. Oper has the following options
0 is Twos complement,
1 is NOR,
2 is AND,
3 is OR,
4 is XOR

MODE 97,A,X,Y
Matrix operation: dimensions of matrix A go to X an Y

MODE 99,0 Breaks on Error (default behavior)
MODE 99,1 Continues execution on Error


I tried to find the address of the special $ variable. It seems to start from address 400.
The last entry line is at address 528. The FXLibrary is at address about 16400.
I also tried the "password erase" offered by Xerxes - it works. The password string is located at address 308.
The variables A-Z are stored backwards from the end of the memory: variable A is at address 16376. Variable B is 8 bits before at 16368 etc. Variable Z is at 16176.
The MEMO-databank seems to be at address 588.
The IN-OUT-CALC string seems to be after the program area - not at fixed address.

Well, another curious thing is that I managed to use 6 more characters from the code table (small D, small L, -1 index, thick /, b/, /c). I did this with using MODE19 to the address of a string variable. Maybe one day somebody will need to use those special chars. Functions like CHR$ and ASC can be substituted by short (1-row) programs, using MODE18 & MODE19.

Also the scan-codes of the special buttons for MODE21 are:


128 - SIN
129 - COS
130 - TAN
134 - LOG
135 - LN
136 - EXP
137 - SQR (square root sign)
152 - DEG(
182 - &H
183 - CUR (cubic root sign)
185 - HYP
205 - X^2
206 - X^3
207 - 10^x
219 - CLS
220 - ENG
222 - STAT
234 - MEMO
235 - EXT
239 - EXE
240 - INS
241 ->
242 <-
244 - STOP
245 - MODE
246 - ^R (return of the last entered line)
247 - Shift
251 - IN
252 - OUT
253 - CALC

The rest of the codes correspond to the letter or sign of the button depending on the char-code table.
I.e. for the key "G" we have 38, and of we are in EXT-mode the code will be 70 (for "g"). For the key "+" the code is 1.

Button BRK doesn't give code as the program execution breaks when it is pressed.
Modifié en dernier par ynopum le 05 mai 2009 07:48, modifié 2 fois.
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 »

ynopnum a écrit :Excuse moi pour l'anglais!
Pas de problème! In fact it's much easier for me. :)

The information wil make it into the table for sure.
And hi, welcome to our community!
Bienvenue dans le club!
Avatar du membre
Pocket
Administrateur
Administrateur
Messages : 5939
Enregistré le : 24 mai 2002 16:55
Localisation : Toulouse
Contact :

Message par Pocket »

Welcome ynopum,

Thanks for these informations.

Don't hesitate to post also a little introduction here ;)
viewforum.php?f=49

Regards,
Pocket, voit tout, sait tout, lit l'avenir dans les entrailles d'une base phpBB ...
Image
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 »

ynopum a écrit :After examining of the quoted program library, and also reading of the forum, and playing with my Casio, I tried to make a list of the undocumented MODE commands. Most of them were already known, but some are not.
Thanks for continuation of discovering the secrets of the MODE commands.
ynopum a écrit :MODE 10
unknown (on a Japanese site they say that it truncates the digits during calculation - I couldn't see any difference)
An example with different output:

10 MODE10
20 PRINT 2-SQR2*SQR2
30 MODE11
40 PRINT 2-SQR2*SQR2

gives 0 and 1e-11


By the way, besides the already known MODE110, I have found the currently unknown commands MODE200 and MODE201 on the VX-4.
The undocumented valid MODE command arguments on this pocket are 10,11,110,200,201.
ynopum
Fonctionne à 75 bauds
Fonctionne à 75 bauds
Messages : 6
Enregistré le : 03 mai 2009 12:36
Localisation : Bulgarie

Message par ynopum »

Thanks! I didn't try square roots.

I did a small proggy for testing of MODE10 & MODE11:

Code : Tout sélectionner

10 INPUT "Expression: ",$
20 MODE 10: MODE 20,V: PRINT "M10: ";V
30 MODE 11: MODE 20,V: PRINT "M11: ";V
99 GOTO 10
The result for the expression ASN ACS ATN TAN COS SIN 9 doesn't change. Also some other expressions with trigonometric functions only.

The most interesting is that the test of Sergey Frolov gives better result on MODE 11, compared with the real answer 1.0000001^(2^27)

Code : Tout sélectionner

A=1.0000001
FOR I=1 TO 27:A=A*A:NEXT I
Casio FX-795P; fx-4500PA; fx-5500LA; fx-6300G; fx-9860G; TI-92Plus
Avatar du membre
Woodstock
Fonctionne à 2400 bauds
Fonctionne à 2400 bauds
Messages : 1969
Enregistré le : 17 mai 2008 11:19
Localisation : Au fin fond du Santerre ...

Message par Woodstock »

Thanks Ynopum, but don't forget what our Great Revered Moderator (!) asks, it' a little rule between the members, here. It's not an investigation, just for knowing you a little better :P :
Pocket a écrit :Don't hesitate to post also a little introduction here ;)
viewforum.php?f=49
I'm the operator
Of my pocket calculator
I am adding
And substracting...
(Kraftwerk, Computer World, 1981)
Avatar du membre
kweeky
Fonctionne à 2400 bauds
Fonctionne à 2400 bauds
Messages : 1777
Enregistré le : 05 oct. 2007 19:46
Localisation : Pas très loin de Bordeaux

Message par kweeky »

Woodstock a écrit :our Great Revered Moderator
May his extreme goodness bless you ! :wink:

@Xerxes : have you some informations on the MODE commands on the VX-4 model (especially MODE200 & 201) ? Thanks !

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

Message par ynopum »

Bien, J'ai ecrit petite histoire des mes calculateurs.

CHR equivalent FUNCTION for FX-795P. The example uses the variable O$ which will contain the result string. The decimal value D must be present in the MODE19 function:

Code : Tout sélectionner

the input is in D
O$="1": MODE 19(16264,D)
the result is in O$
ASC equivalent function.

Code : Tout sélectionner

the input is in O$
MODE 18(16264,O):O$="&H"+O$:D=VAL(O$)
the result is in D
O$ is changed!
You can use another string variable to avoid changing of the source O$.

If O$ is not suitable, here is the list of the addresses of the other variables:

Code : Tout sélectionner

Var	Address
A	16376
B	16368
C	16360
D	16352
E	16344
F	16336
G	16328
H	16320
I	16312
J	16304
K	16296
L	16288
M	16280
N	16272
O	16264
P	16256
Q	16248
R	16240
S	16232
T	16224
U	16216
V	16208
W	16200
X	16192
Y	16184
Z	16176
Those addresses are ONLY FOR FX-795P, they should be different on the older models because the memory size is different
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 »

ynopum a écrit :I did a small proggy for testing of MODE10 & MODE11:

Code : Tout sélectionner

10 INPUT "Expression: ",$
20 MODE 10: MODE 20,V: PRINT "M10: ";V
30 MODE 11: MODE 20,V: PRINT "M11: ";V
99 GOTO 10
...
The most interesting is that the test of Sergey Frolov gives better result on MODE 11, compared with the real answer 1.0000001^(2^27)

Code : Tout sélectionner

A=1.0000001
FOR I=1 TO 27:A=A*A:NEXT I
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.
kweeky a écrit :@Xerxes : have you some informations on the MODE commands on the VX-4 model (especially MODE200 & 201) ? Thanks !
Sorry kweeky, but I have no idea about MODE200/201. It's just the result of an idea of how to find all valid MODE arguments.
Répondre

Retourner vers « Tous les Pockets »