π
<-
Chat plein-écran
[^]

ICE Compiler

Assembleur, Axe, C/C++, ICE...

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude PT_ » 28 Mai 2016, 10:19

I'm very happy to say that parsing a mathematical expression is almost done! :)
It now 'chains' operators, i.e. A*B+3, instead of the seperate routines for A*B and A+3 for example. Out of the 14 booleans/operators (+ - * / or xor and -> => <= > < = !=) I've finished 10. I only need >= <= > < to do, and after that, I'm ready with parsing such string (yet without functions). I haven't implemented auto-opt yet, but I will definitely do. Here is an example of what it can do:
String = A+4*B/(1-C)+3
Output =
Code: Tout sélectionner
ld a, ($D05301)    ; B
add a, a
add a, a
push af
   ld a, 1
   ld hl, $D05302  ; C
   sub a, (hl)
pop hl
ld l, 1
mlt hl
call _DivHLByA
ld a, l
ld hl, $D05300     ; A
add a, (hl)
add a, 3
ret
The only good optimization I see is replacing the "push af" with "ld h, a" and remove the "pop hl".
Age of CEmpires I - In progress!
40%
Avatar de l’utilisateur
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Prochain niv.: 57.2%
 
Messages: 259
Inscription: 09 Fév 2016, 23:06
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude Adriweb » 28 Mai 2016, 11:09

Nice ! Good luck for the rest :D
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80.2%
 
Messages: 14614
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude Epharius » 28 Mai 2016, 20:42

Yeah! You finally did it! What are you gonna do then?
Le projet Geometry Dash est terminé ! N'hésitez pas à aller jeter un coup d’œil au topic du projet ! Vous pouvez le télécharger ici.

Unis par la flèche sacrée de cupidon :favorite:
Image
Avatar de l’utilisateur
EphariusPremium
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 7.1%
 
Messages: 1110
Images: 4
Inscription: 08 Déc 2014, 17:38
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
Classe: Ensimag
GitHub: MathisLav

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude PT_ » 28 Mai 2016, 22:07

Epharius a écrit:Yeah! You finally did it! What are you gonna do then?

Version 1.0.0: June XX, 2016
☑ Adding, substracting, multiplication, dividing
☑ Parenthesis
☑ Booleans, comparisons
☑ Storing, variables
☑ Run inline ASM
☑ Display integers
☑ ClrHome
☐ If, Repeat, While
☐ Lbl, Goto
Age of CEmpires I - In progress!
40%
Avatar de l’utilisateur
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Prochain niv.: 57.2%
 
Messages: 259
Inscription: 09 Fév 2016, 23:06
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude Flip » 01 Juin 2016, 10:33

good job, I'm waiting for your first release... :)
Image

Universalis, un de mes meilleurs programmes TI 83 PCE

Avancement du projet Color Switch:
100%

feature en cours:
embellissement du gameplay
N'hésitez pas à télécharger, ça fait toujours plaisir ;) : archives_voir.php?id=873936
Avatar de l’utilisateur
FlipProgrammeur
Niveau 10: GR (Guide de Référence)
Niveau 10: GR (Guide de Référence)
Prochain niv.: 81.9%
 
Messages: 77
Images: 0
Inscription: 03 Nov 2015, 10:57
Localisation: Toulouse, France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: PCSI 1ere année
Facebook: profile.php?id=100010687478140

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude PT_ » 01 Juin 2016, 18:12

I DID IT!!!!!!!!!

I'm so happy now :) I succesfully compiled a normal program, without any errors :D

Ofc, I've finally a gif for you guys!
Image

The program is still far from perfect, but I'm more than happy with this now :D

EDIT:
Image
Image
Age of CEmpires I - In progress!
40%
Avatar de l’utilisateur
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Prochain niv.: 57.2%
 
Messages: 259
Inscription: 09 Fév 2016, 23:06
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude Adriweb » 01 Juin 2016, 19:07

Awesome, congratulations 8-)
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80.2%
 
Messages: 14614
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude Epharius » 02 Juin 2016, 18:15

Congratulation, is there a link somewhere to download the program? I would like to know how does it work, or if you don't want to share the code, just try it ;)

Good job!
Le projet Geometry Dash est terminé ! N'hésitez pas à aller jeter un coup d’œil au topic du projet ! Vous pouvez le télécharger ici.

Unis par la flèche sacrée de cupidon :favorite:
Image
Avatar de l’utilisateur
EphariusPremium
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 7.1%
 
Messages: 1110
Images: 4
Inscription: 08 Déc 2014, 17:38
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
Classe: Ensimag
GitHub: MathisLav

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude PT_ » 02 Juin 2016, 19:03

Epharius a écrit:Congratulation, is there a link somewhere to download the program? I would like to know how does it work, or if you don't want to share the code, just try it ;)

Good job!

I haven't uploaded it yet, because v1.0 is not ready. You want to know how this works? Well, ofc I can explain it! It reads the program line by line. For example, if it reads a "ClrHome", it adds the corresponding code to the program data, and continues with the next line (if there is one). Or it reads the If-token. Now it first expresses the remains of the line (after the If-token), adds that to the program data, pushes some values here and there, and reads the next line. If that is a "Then", it pushes an End (kind of), and otherwise, that line will be parsed, and the values will be popped, because the If-statement is over. That is basically how it works. Hope that that is enough :)
Age of CEmpires I - In progress!
40%
Avatar de l’utilisateur
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Prochain niv.: 57.2%
 
Messages: 259
Inscription: 09 Fév 2016, 23:06
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ICE - an interpreter/compiler of CE-BASIC

Message non lude Epharius » 02 Juin 2016, 19:35

Yea, I did something similar with that program.

Anyway, I'll wait for the first release to try ICE ;)
Le projet Geometry Dash est terminé ! N'hésitez pas à aller jeter un coup d’œil au topic du projet ! Vous pouvez le télécharger ici.

Unis par la flèche sacrée de cupidon :favorite:
Image
Avatar de l’utilisateur
EphariusPremium
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 7.1%
 
Messages: 1110
Images: 4
Inscription: 08 Déc 2014, 17:38
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
Classe: Ensimag
GitHub: MathisLav

PrécédenteSuivante

Retourner vers Langages alternatifs

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 15 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1415 utilisateurs:
>1380 invités
>31 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)