[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.
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.
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.
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.
Citer : Posté le 19/01/2019 19:33 | #
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
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
Mon blog ⋅ Mes autres projets
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?
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.
Citer : Posté le 03/02/2019 11:11 | #
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.
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.
Citer : Posté le 13/07/2023 11:29 | #
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)
libMicrofx : https://www.planet-casio.com/Fr/forums/topic17259-2-libmicrofx-remplacez-fxlib-pour-faire-des-add-ins-tres-legers.html !
Racer3D : https://www.planet-casio.com/Fr/programmes/programme4444-1-racer3d-mb88-jeux-add-ins.html