π
<-
Chat plein-écran
[^]

ICE Compiler

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

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

Unread postby PT_ » 28 May 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: Select all
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%
User avatar
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Level up: 57.2%
 
Posts: 259
Joined: 09 Feb 2016, 23:06
Gender: Male
Calculator(s):
MyCalcs profile

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

Unread postby Adriweb » 28 May 2016, 11:09

Nice ! Good luck for the rest :D

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...)
My calculator programs
Mes programmes pour calculatrices
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 78.4%
 
Posts: 14670
Images: 1118
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
MyCalcs profile
Twitter: adriweb
GitHub: adriweb

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

Unread postby Epharius » 28 May 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
User avatar
EphariusPremium
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 7.7%
 
Posts: 1148
Images: 4
Joined: 08 Dec 2014, 17:38
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ensimag
GitHub: MathisLav

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

Unread postby PT_ » 28 May 2016, 22:07

Epharius wrote: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%
User avatar
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Level up: 57.2%
 
Posts: 259
Joined: 09 Feb 2016, 23:06
Gender: Male
Calculator(s):
MyCalcs profile

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

Unread postby Flip » 01 Jun 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
User avatar
FlipProgrammeur
Niveau 10: GR (Guide de Référence)
Niveau 10: GR (Guide de Référence)
Level up: 81.9%
 
Posts: 77
Images: 0
Joined: 03 Nov 2015, 10:57
Location: Toulouse, France
Gender: Male
Calculator(s):
MyCalcs profile
Class: PCSI 1ere année
Facebook: profile.php?id=100010687478140

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

Unread postby PT_ » 01 Jun 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%
User avatar
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Level up: 57.2%
 
Posts: 259
Joined: 09 Feb 2016, 23:06
Gender: Male
Calculator(s):
MyCalcs profile

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

Unread postby Adriweb » 01 Jun 2016, 19:07

Awesome, congratulations 8-)

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...)
My calculator programs
Mes programmes pour calculatrices
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 78.4%
 
Posts: 14670
Images: 1118
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
MyCalcs profile
Twitter: adriweb
GitHub: adriweb

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

Unread postby Epharius » 02 Jun 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
User avatar
EphariusPremium
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 7.7%
 
Posts: 1148
Images: 4
Joined: 08 Dec 2014, 17:38
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ensimag
GitHub: MathisLav

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

Unread postby PT_ » 02 Jun 2016, 19:03

Epharius wrote: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%
User avatar
PT_Programmeur
Niveau 13: CU (Calculateur Universel)
Niveau 13: CU (Calculateur Universel)
Level up: 57.2%
 
Posts: 259
Joined: 09 Feb 2016, 23:06
Gender: Male
Calculator(s):
MyCalcs profile

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

Unread postby Epharius » 02 Jun 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
User avatar
EphariusPremium
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 7.7%
 
Posts: 1148
Images: 4
Joined: 08 Dec 2014, 17:38
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ensimag
GitHub: MathisLav

PreviousNext

Return to Langages alternatifs

Who is online

Users browsing this forum: No registered users and 4 guests

-
Search
-
Social TI-Planet
-
Featured topics
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Offre de test des nouveautés de rentrée 2024 par Casio. Enseignant(e), reçois gratuitement 1 exemplaire, à ton choix, de la Graph Light ou bien de la Graph Math+
14€ remboursés par Casio sur l'achat de ta calculatrice Graph 35 d'ici le 31 Octobre 2024
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 90+E d'ici le 31 Décembre 2024
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 25 d'ici le 31 Décembre 2024
8€ remboursés par Casio sur l'achat de ta calculatrice Graph Math+ d'ici le 31 Octobre 2024
Reprise de ton ancienne fx-92 Collège ou Graph 25/35/90 à 3€ peu importe son état. Même non fonctionnelle et donc invendable, même ancienne Graph 35 non conforme aux programmes (pas de Python), même ancienne Graph 25/35 inutilisable aux examens (pas de mode examen) et donc invendable. Etiquette de retour fournie, pas de frais de port à payer.
3€ remboursés par Casio sur l'achat de ta calculatrice fx-92 Collège d'ici le 30 Septembre 2024
5€ de remise immédiate sur l'achat de ta calculatrice TI-83 Premium CE Edition Python chez les revendeurs partenaires
4€ de remise immédiate sur l'achat de ta calculatrice TI-82 Advanced Edition Python chez les revendeurs partenaires
3€ de remise immédiate sur l'achat de ta calculatrice TI-82 Advanced chez les revendeurs partenaires
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234567891011121314
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1280 utilisateurs:
>1252 invités
>22 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)