π
<-
Chat plein-écran
[^]

ICE Compiler

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

ICE Compiler

Unread postby PT_ » 23 Mar 2016, 08:05

Hello everyone!

I can imagine many, many people are waiting for this post, but yeah, one must be the first to start such project ;)
I want to introduce this program:

ICE - an interpreter/compiler of CE-BASIC

Hooray! It would look like Axe Parser, but then for the newest calculator, the TI-84+CE.
Now are there many people who have questions, about what is possible with it, how long would it take to complete, what are the pros/cons?
Let me answer some questions.

What is ICE?
ICE is an interpreter/compiler of CE-BASIC. Normally, the OS reads a BASIC programs, and compiles it to some ASM commands, and then execute it. ICE does almost the same, but only read it, and compiles it to ASM commands, but instead of executing, it stores them into another program! In that way, you can turn your BASIC program into an ASM one, which is 1000x faster.

Why ICE?
Because I want to make a cool project (and not only games), and I think this program would be very useful for many people, so I decided to give it a try :)

What is possible with ICE?
I've no details yet, because I'm in an early stage, but I want to make it possible to keep it as BASIC as possible. I mean, you should be able in the future to compile all the BASIC programs to ASM. I never gonna reach that.... Like Axe Parser, it doesn't work with the TI-OS variables, because they are sloooowwwww. Instead, all the variables are in the RAM.

What are the pros and cons of ICE?
You can compile almost all the BASIC programs to ASM, which is 1000x faster. Since the CE has a memory-mapped screen, I'm going to implement a bunch of graph routines as well. A disadvantage is that you're a bit limited with the BASIC commands. I hope I can explain this later

When will you finish it?
In these weeks, I'm busy with school stuff, so I can't really do something with programming. But after that, I hope to finish it as fast as possible. Depending on the difficulties, I hope to finish it in some monts :)

How works ICE?
The hardest part is to express a string (and eventually store it to a variable). I will implement the Shunting-Yard-Algorithm for that (I will explain later). Once I got that ready, I need to write routines that replaces BASIC commands, like [mono]ClrHome[/mono] would be [mono]call _HomeUp / call _ClrTxtShdw[/mono] or whatever. Once THAT is ready, or enough of them, I will release a beta :)`

How smart is ICE?
For now, it is pretty smart, and by "smart" I mean, that if you display 2 strings which are exactly the same, it will be only once in RAM, an example:
Code: Select all
Disp "ICE","ICE"

would be this:
Code: Select all
   call _NewLine
   ld hl, _pointer_disp_0
   call _PutS
   call _NewLine
   ld hl, _pointer_disp_0
   call _PutS
   ret

_pointer_disp_0:
   .db "ICE", 0
or
Code: Select all
   call _NewLine
   ld hl, _pointer_disp_0
   push hl
      call _PutS
      call _NewLine
   pop hl
   call _PutS
   ret

_pointer_disp_0:
   .db "ICE", 0

which saves some RAM.

Example of Shunting-Yard-Algorithm:
Let's say I have this code:
Code: Select all
F/2+3->A

The algorithm converts this to:
Code: Select all
F 2 / 3 + A ->

Now I gonna read this sentence, and convert it to this (for example code)
Code: Select all
   ld a, (address_of_variable_F)
; Now I now that I need to divide A by 2, which is a power of 2, so just rotate the byte
   or a
   rra
; Now to add 3, which is a value, not a variable
   add a, 3
; Now store it to variable A, so
   ld (address_of_variable_A), a

This is basically how the algorithm works, but then a bit more complicated :P especially when you have a long string.

Progress:
As some of you may know, it's very hard to work in ASM :P. That is why I decided to first create this in PHP (that's why I asked how to read .8xp with PHP). After I finished that, I will port it to ASM. I'm now in the stage for developing the Shunting-Yard-Algorithm, which is the main and hardest part.

I know, there are still a ton of questions, so feel free to ask anything if you don't understand it, or whatever you want to say! :)



Current version: 1.1
archives_voir.php?id=587211
Last edited by PT_ on 07 Jul 2016, 19:17, edited 2 times in total.
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 GalacticPirate » 23 Mar 2016, 12:39

Great work PT_ :)
Mon profil TI-PlanetDevenez premium !
ImageImage
Modérateur de TI-Planet.org depuis décembre 2015, et membre de la communauté depuis Mai 2015.Cliquez ci-dessus pour faire un don à TI-Planet.org via PayPal et devenir Donateur ou Premium (à partir de 3€) ! Vous aurez accès à des générations illimitées et prioritaires avec Mviewer GX Creator, ainsi qu'au forum secret ! :bj: En plus, vous pourrez être orange sur le chat :troll:

Image
User avatar
GalacticPirateModo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 1.3%
 
Posts: 1156
Images: 2
Joined: 23 May 2015, 10:36
Location: Hauts-de-Seine, France
Gender: Male
Calculator(s):
MyCalcs profile
Class: L3 Informatique
GitHub: GalacticPirate-Prog

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

Unread postby Ti64CLi++ » 23 Mar 2016, 13:25

Good work PT_
Image
User avatar
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 32.4%
 
Posts: 3444
Images: 75
Joined: 04 Jul 2014, 14:40
Location: Clermont-Ferrand 63
Gender: Male
Calculator(s):
MyCalcs profile
Class: ENS Rennes
GitHub: Ti64CLi

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

Unread postby Hayleia » 23 Mar 2016, 15:09

There is something I didn't really get with your project.
Is it a new language based on Basic tokens (like Axe was) or a Basic compiler (like Axe wasn't) ?

Either way, it's good to take and I wish you luck with this, but you compare your project several times with Axe but on the other hand you also say it's a Basic compiler so I have no idea what I am reading :P

Image
ImageImageImage
Pokemon Topaze (Axe) discussion and download links here
(19:29:36) noelnadal: plus sérieusemen​t, j'ai très peu de problèmes
(22:45:44) Clifward: J'aime rire du malheur des autres :troll:

(2017.11.18 - 17:07:12) Fireworks: Hayleia !!!!!
(2017.11.18 - 17:07:19) TI-Bot: Fireworks has been logged out (Kicked).
(2017.11.18 - 17:07:22) TI-Bot: Ban of user Fireworks revoked.
(2017.11.18 - 17:07:25) TI-Bot: Fireworks logs into the Chat.
(2017.11.18 - 17:07:28) Fireworks: <3
(2017.11.18 - 17:07:31) Fireworks: 208
User avatar
HayleiaGénéreux
Niveau 17: GM (Grand Maître des calculatrices)
Niveau 17: GM (Grand Maître des calculatrices)
Level up: 43.8%
 
Posts: 2509
Images: 2
Joined: 30 Aug 2011, 08:22
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Templar

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

Unread postby PT_ » 23 Mar 2016, 17:09

Hayleia wrote:There is something I didn't really get with your project.
Is it a new language based on Basic tokens (like Axe was) or a Basic compiler (like Axe wasn't) ?

Either way, it's good to take and I wish you luck with this, but you compare your project several times with Axe but on the other hand you also say it's a Basic compiler so I have no idea what I am reading :P

A compiler is such program that converts a programming language to another. Axe Parser reads the program with BASIC tokens, and converts it to ASM commands. My program will do exactly the same :)
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 Hayleia » 23 Mar 2016, 19:38

PT_ wrote:
Hayleia wrote:There is something I didn't really get with your project.
Is it a new language based on Basic tokens (like Axe was) or a Basic compiler (like Axe wasn't) ?

Either way, it's good to take and I wish you luck with this, but you compare your project several times with Axe but on the other hand you also say it's a Basic compiler so I have no idea what I am reading :P

A compiler is such program that converts a programming language to another. Axe Parser reads the program with BASIC tokens, and converts it to ASM commands. My program will do exactly the same :)

Ok, but that compiler can have several behaviours. For example, if there is a line that only has "+1" on it, does it compile or not ? If it doesn't compile, then it's not a TI-Basic compiler, and the Axe Parser does compile that line, so it's an Axe compiler and not a Basic compiler, even though they are both based on the same tokens.

Image
ImageImageImage
Pokemon Topaze (Axe) discussion and download links here
(19:29:36) noelnadal: plus sérieusemen​t, j'ai très peu de problèmes
(22:45:44) Clifward: J'aime rire du malheur des autres :troll:

(2017.11.18 - 17:07:12) Fireworks: Hayleia !!!!!
(2017.11.18 - 17:07:19) TI-Bot: Fireworks has been logged out (Kicked).
(2017.11.18 - 17:07:22) TI-Bot: Ban of user Fireworks revoked.
(2017.11.18 - 17:07:25) TI-Bot: Fireworks logs into the Chat.
(2017.11.18 - 17:07:28) Fireworks: <3
(2017.11.18 - 17:07:31) Fireworks: 208
User avatar
HayleiaGénéreux
Niveau 17: GM (Grand Maître des calculatrices)
Niveau 17: GM (Grand Maître des calculatrices)
Level up: 43.8%
 
Posts: 2509
Images: 2
Joined: 30 Aug 2011, 08:22
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Templar

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

Unread postby PT_ » 23 Mar 2016, 19:42

Hayleia wrote:
PT_ wrote:
Hayleia wrote:There is something I didn't really get with your project.
Is it a new language based on Basic tokens (like Axe was) or a Basic compiler (like Axe wasn't) ?

Either way, it's good to take and I wish you luck with this, but you compare your project several times with Axe but on the other hand you also say it's a Basic compiler so I have no idea what I am reading :P

A compiler is such program that converts a programming language to another. Axe Parser reads the program with BASIC tokens, and converts it to ASM commands. My program will do exactly the same :)

Ok, but that compiler can have several behaviours. For example, if there is a line that only has "+1" on it, does it compile or not ? If it doesn't compile, then it's not a TI-Basic compiler, and the Axe Parser does compile that line, so it's an Axe compiler and not a Basic compiler, even though they are both based on the same tokens.

If my Shunting Yard Algorithm read that, it will become
Code: Select all
1 +
and that will give an error, because you add nothing to 1, which is impossible :) Such errors are easy to check, there are even more complicated ones.
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 Hayleia » 23 Mar 2016, 19:54

PT_ wrote:If my Shunting Yard Algorithm read that, it will become
Code: Select all
1 +
and that will give an error, because you add nothing to 1, which is impossible :) Such errors are easy to check, there are even more complicated ones.

Ok, then it might be a Basic compiler indeed, and isn't similar to Axe.

PT_ wrote:A compiler is such program that converts a programming language to another. Axe Parser reads the program with BASIC tokens, and converts it to ASM commands. My program will do exactly the same :)

Also, not really. A compiler is (in basic terms) a set of instructions and a behaviour for them. Then, if your compiler "translates" your set of instructions into another language without changing the behaviour, then it's a compiler. That's why the Axe Parser isn't a Basic compiler but an Axe compiler.

Image
ImageImageImage
Pokemon Topaze (Axe) discussion and download links here
(19:29:36) noelnadal: plus sérieusemen​t, j'ai très peu de problèmes
(22:45:44) Clifward: J'aime rire du malheur des autres :troll:

(2017.11.18 - 17:07:12) Fireworks: Hayleia !!!!!
(2017.11.18 - 17:07:19) TI-Bot: Fireworks has been logged out (Kicked).
(2017.11.18 - 17:07:22) TI-Bot: Ban of user Fireworks revoked.
(2017.11.18 - 17:07:25) TI-Bot: Fireworks logs into the Chat.
(2017.11.18 - 17:07:28) Fireworks: <3
(2017.11.18 - 17:07:31) Fireworks: 208
User avatar
HayleiaGénéreux
Niveau 17: GM (Grand Maître des calculatrices)
Niveau 17: GM (Grand Maître des calculatrices)
Level up: 43.8%
 
Posts: 2509
Images: 2
Joined: 30 Aug 2011, 08:22
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Templar

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

Unread postby Epharius » 23 Mar 2016, 21:04

Finally! :D
Indeed, the basic variables are very slow, and that's not a good idea to RCL/STO in these vars everytime. You told me that (maybe) it will be possible to choose a specific variable (such as X,Y,Z) slower than the others, to store decimal numbers, do you still plan to do that?
Anyway, good luck! ;)

Oh and, by the way, ice is already used :p
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: 1146
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_ » 23 Mar 2016, 21:12

Epharius wrote:Finally! :D
Indeed, the basic variables are very slow, and that's not a good idea to RCL/STO in these vars everytime. You told me that (maybe) it will be possible to choose a specific variable (such as X,Y,Z) slower than the others, to store decimal numbers, do you still plan to do that?
Anyway, good luck! ;)

Oh and, by the way, ice is already used :p

I have yet no idea about how to recognize 1-byte integers, 3-byte integers and decimal numbers. Still need to think about it :?
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

Next

Return to Langages alternatifs

Who is online

Users browsing this forum: No registered users and 14 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.
1039 utilisateurs:
>990 invités
>44 membres
>5 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)