Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Autres questions


Index du Forum » Autres questions » [CasioBasic] / [C ++] - Comment appeler une fonction externe
Warioss Hors ligne Membre Points: 11 Défis: 0 Message

[CasioBasic] / [C ++] - Comment appeler une fonction externe

Posté le 18/01/2019 22:25

Bonjour à tous. Je voulais créer un programme ou dans "Casio Basic" (avec l'éditeur de la calculatrice) ou en "C ++" (avec turboC ++), qui devrait pouvoir prendre une expression symbolique et y effectuer des multiplications et des dérivés. Par exemple :
>> "Entrez une fonction:"
>>? -> A; (exemple A = (5x) / ((x-1) s))
>> d / dx (A, x) -> B (donc dans B il y aura (5 (s - 1)) / (s x - 1) ^ 2)
>> B * (s-1) -> C (donc dans C il y aura 5 (s - 1) ^ 2) / (s x - 1) ^ 2)
>> C (imprimer C)

J'avais pensé, s'il était possible, créer une sorte de script par le mécanisme des appels externes: c'est-à-dire appeler, par exemple, le ADD-INS "CAS" déjà installé dans mon algèbre FX 2.0 Plus et l'envoyer, en tant que paramètres, la fonction à exécuter, par exemple "d / dx (A, x) -> B", de cette manière j'aurais dans "B" l'expression "(5 (s - 1)) / (sx - 1 ) ^ 2 ", et ainsi de suite.

Y a-t-il une chance de faire quelque chose comme ça? C’est-à-dire, appeler un add-ins de CasioBasic / C? Ou avez-vous une autre solution en tête pour créer un programme capable de faire de quoi ai-je besoin?? Merci d'avance.


Lephenixnoir Hors ligne Administrateur Points: 24229 Défis: 170 Message

Citer : Posté le 18/01/2019 22:57 | #


Salut ! Juste une impression de ma part, mais si tu préfères parler en anglais, n'hésite pas.

L'Algebra-fx 2.0+ est un assez vieux modèle sous DOS (Graph 100+ en France) et je ne pense pas qu'il reste grand-monde qui en ai déjà utilisé une. J'espère que tu n'es pas trop pressé...

Appeler un programme externe ne renverra probablement pas une donnée sous la forme que tu attends parce que les programmes ne produisent généralement pas une structure de donnée en sortie, mais du texte et un code d'erreur (via les flux standard). Je ne connais pas les détails de la machine, mais ça paraît difficile.

Une solution plus propre serait d'avoir des commandes de calcul formel dans un programme Basic. Malheureusement, le manuel ne propose rien de tel.

N'ayant pas de Graph 100+, je ne peux pas t'aider plus dans l'immédiat.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Warioss Hors ligne Membre Points: 11 Défis: 0 Message

Citer : Posté le 18/01/2019 23:19 | #


Hello Lephenixnoir, thank you very much for your interest and thanks for allowing me to write in English, I apologize for my very bad French.
However I understood what you said ... it would be nice to produce a sequence of automated operations to be used directly in the add-ins CAS pre-installed in my graph 100+ calculator.
Unfortunately I think this is not possible and I do not think it is possible to create a program for symbolic calculation ("calcul formel") with a little evolved IDE like turboC ++.
Maybe it's better to give up, I would not know how to do a program that does everything I've described.
Lephenixnoir Hors ligne Administrateur Points: 24229 Défis: 170 Message

Citer : Posté le 19/01/2019 09:41 | #


I thought CAS models would expose the symbolic computation commands in the Basic language, but it seems this is more complicated.

I'd not give up until someone who actually knows the machine provides an answer, but it's frustrating for sure.

Oh, and I guess you could compile a CAS program with turbo C++ or any other kind of IDE, but that would be a lot of work and it would kind of break the purpose of using a native-CAS machine.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Warioss Hors ligne Membre Points: 11 Défis: 0 Message

Citer : Posté le 19/01/2019 19:33 | #


Lephenixnoir a écrit :
I thought CAS models would expose the symbolic computation commands in the Basic language, but it seems this is more complicated.

I'd not give up until someone who actually knows the machine provides an answer, but it's frustrating for sure.

Oh, and I guess you could compile a CAS program with turbo C++ or any other kind of IDE, but that would be a lot of work and it would kind of break the purpose of using a native-CAS machine.


I've found C++ libraries about symbolic calculation, but it's very hard to compile them with TurboC++ (but I'm forced to use TurboC++ 'cause it is the only IDE that can generate a .exe for 16 bit DOS for the 80286 CPU family).
I sincerely hope that someone has some better idea to create the program I have requested. Thanks again for the interest
Cakeisalie5 En ligne Ancien administrateur Points: 1909 Défis: 11 Message

Citer : Posté le 21/01/2019 14:58 | #


What about Open Watcom instead of Turbo C++? I haven't tested it, but it seems to be able to compile to 16-bit DOS. (although you won't find any AFX-related help using Open Watcom, I should think, as the guides I have for programming for the AFX all use Turbo C++)

PS: as you understand French, maybe you'll find what you're looking for on graph100.com's forum, which has been archived at my demand a few years ago now. (I have only overlooked the AFX myself, so I'm not really able to help you personnally… sorry)

PPS: Digital Mars seems to have been used as well (although it was probably only a C compiler at the time)… the executable is still available here, although I don't know if it really answers your problem

Promotion ordinaire sur les inscriptions sur Planète Casio : en ce moment, c'est gratuit !

Mon blogBesoin d'utilitaires de transfert vers et depuis la calculatrice sous GNU/Linux ?
Warioss Hors ligne Membre Points: 11 Défis: 0 Message

Citer : Posté le 02/02/2019 19:27 | #


@ Cakeisalie5: Thank you very much, but I think it is too exaggerated to program a CAS-System from scratch, especially with so old compilers. I was able to find the download of the original CAS2 of the Graph100+ in .cfx format: https://www.sendspace.com/file/7xbae8 of which I managed to extract the .exe: https://www.sendspace.com/file/ctvjro . The problem would now be to go back to the source code, does anyone have any idea about it? Or how can this .cfx / .exe be exploited?
Lephenixnoir Hors ligne Administrateur Points: 24229 Défis: 170 Message

Citer : Posté le 02/02/2019 20:20 | #


Good job getting back the executable file!

You can get the assembler source, but not the source in the original language. I've checked the file and the source code is not there (as it is sometimes when compiling development versions). This is not a surprise: debug executables on an embedded systems makes little to no sense.

Editing the assembler code is bound to be difficult. You might be able to add a few functions to call the CAS from an external application without changing the symbolic engine, but it will definitely require an expert's level of assembler programming.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Warioss Hors ligne Membre Points: 11 Défis: 0 Message

Citer : Posté le 03/02/2019 11:11 | #


Lephenixnoir a écrit :
Good job getting back the executable file!
but it will definitely require an expert's level of assembler programming.


Yes, you're right, I think it's really hard to understand the assembly code directly and use it to add new features to the CAS program.

One last alternative I found could be mathomatic: http://mathomatic.orgserve.de/math/. It has small dimensions: << (0.29 megabytes) of the latest source code and documentation release: version 16.0.5 >> (I think 0.29 Mb are adequate for the calculator), it is portable: << Mathomatic compiles correctly for any computer architecture, including 16, 32, and 64-bit word size >>. It only remains to understand well how to make a porting for the calculator.
Lephenixnoir Hors ligne Administrateur Points: 24229 Défis: 170 Message

Citer : Posté le 03/02/2019 11:30 | #


The build systems looks really friendly and tweakable (unlike CMake-generated things or the like), so I guess you can start by installing a suitable command-line compiler and try building naively.

If you need any help trying that, feel free to ask.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Mb88 Hors ligne Labélisateur Points: 944 Défis: 3 Message

Citer : Posté le 13/07/2023 11:29 | #


Cakeisalie5 a écrit :
What about Open Watcom instead of Turbo C++?


I've tried it already one time, and I could not get it working on linux properly (header files not found etc.), but it worked very well on windows xp (so it should work on windows 10/11)

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 153 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd