π
<-
Chat plein-écran
[^]

ICE Compiler

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

Re: ICE Compiler

Message non lude PT_ » 25 Aoû 2016, 22:05

Epharius a écrit:Well, you just have to check whether you're in the [prgm] menu or not. If so, you display your menu. Else, you let the calculator do its job ;)
(have a look at "menuCurrent")

Ah, that's another good trick. Maybe support both. (Btw, I know exactly how menuCurrent works ;) )
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 Compiler

Message non lude PT_ » 20 Sep 2016, 13:03

Well, I'm really busy with school, so not really enough time to finish the next version. Despite that kind of struggles, I implemented lists, and only 2 options: storing a fixed custom list to an OS list (fixed = only integers allowed, no variables or whatever) and also doing operations on a single list element, like 5+L1(A-3) works too.
My test code was this:
Code: Tout sélectionner
A-(3-L1(A-(B-3
which is only 14 bytes. ICE turns this into:
Code: Tout sélectionner
-- ld ix, cursorImage
ld hl, (ix+3)
dec hl
dec hl
dec hl
ex de, hl
ld hl, (ix)
or a
sbc hl, de
ld de, saveSScreen
add hl, de
ld de, (hl)
ld hl, 3
or a
sbc hl, de
ex de, hl
ld hl, (ix)
or a
sbc hl, de
which is, if I'm right, 32/37 bytes. A bit too much, but I'm still proud of it ;)

Also, I'm still working on the auto-optimization, which is pretty hard.

-- calc84 pointed me to a bug, that the offset to a list element needs to be multiplied with 3. Should be easy to fix though.

That said, the whole code for one operator ( - ) is done, which means I can continue with the others. That should go a little bit faster though, because I have the structure done.
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 Compiler

Message non lude PT_ » 24 Sep 2016, 20:24

So I finally had a free day, so I made a lot of changes:
  • You can now (re)compile archived programs
  • ICE now compiles the whole program, instead of only the first line
  • Fixed main structure
  • Fixed operators + and -, the other 12 need to be done soon :|
  • Added the function not(
  • Added the structure for my custom tokens, still need to start with
  • My custom tokens are now replacements of statistics tokens, instead of accented letters. I did this because TI-Planet members told me at least French people use them more than normal.
  • Removed the Inc( and Dec( token, because these are only useful for 1-byte variables.
  • Added the tokens switch( and case: which could be very useful in programming
  • Added some safety. If it encounters an error, it jumps to a function that display the error string, but then it may happen that the stack is messed up, so I stored the beginning stack pointer somewhere, and recall it before an error.
To-Do-List for the next release:
  • Cesium icon/description
  • Auto-optimization
  • Finish operators (2/14 done). This gonna take time
  • Add more functions, at least the custom ones
  • When you have only once Input , it would be faster and smaller to move that directly into the output program, instead of calling it, like this:
    Code: Tout sélectionner
    <code>
    <input code>
    <code>
    ret
    instead of
    Code: Tout sélectionner
    <code>
    call <input>
    <code>
    ret
    <input code>
  • Get right random routine.
Well, every week I'm pretty busy, so I guess not many time for programming sadly :(
Dernière édition par PT_ le 24 Sep 2016, 20:30, édité 1 fois.
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 Compiler

Message non lude Adriweb » 24 Sep 2016, 20:26

That's a pretty nice list of changes, gg :)
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: 14616
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: ICE Compiler

Message non lude PT_ » 26 Sep 2016, 22:24

Well, I had a *little bit* more free time as I thought, so I made some important changes.

First of all I want to show you the speed of ICE. Here it compiles at program with the normal header and 150 lines with the same code: "3+4-L1((3+A)-B->C+3->L1(4". Guess how fast? See it!
Image
It crashes at the end. Debugging would be fun.....

Notice: CEmu seems to be much slower when recording. In real time, compiling takes seriously about 1/3 second, INSANE FAST :D :D :D

I've added the rand-routine, as already said. 28 bytes with a speed of 181cc is not bad, I would say. Again, thousands of bugfixes, it seems I always make errors :P Besides that, I started with the code for my custom tokens, and ReadByte( seems to work.

For all ReadByte, ReplaceByte, AddByte and DeleteByte, I will add a mode option, like ReadByte(<mode>,<address>). Mode = 0 means reading an offset in the program (I will explain later) and mode 1 means reading directly from the memory. I will explain later, and give some code. At last I finished the 2 operators, and I think they are bugless, so happy time!
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 Compiler

Message non lude PT_ » 27 Sep 2016, 16:12

Because it's possible, I added again a bunch of thinks.
  • Added operators * and /. Together this took about 15 minutes :) (4/14 done)
  • jacobly and I discussed some main points about where to store the output program (before it will be created). I figured out that if the output program size > 6500 bytes or so, then the calc will crash, because then it's bigger than the size of ICE itself, and other important data get overwritten. Instead, I located the stacks to saveSScreen and the output program to vRAM+320*240. There I will have 76800 bytes of free RAM, enough for a nice program
  • Want to see speed? Here, ICE compiles a program which consists of 1200 lines full of "3+4-L1((3+A)-B->C+3->L1(4".
    Image
    (Real speed = ^ speed * 2)
  • I've added a kind of statusbar, as you can see in the image, but it's only useful for pretty large programs.
  • Bugfixes + less output size
  • Fixed important bug with selecting a program from the list if you want to scroll.
  • Added about 1000 bytes, not important
  • If all goes right, ICE now triggers an error if you have not enough RAM to store the program, but I haven't tested it - it's hard to fill the 154kB :P
  • Fixed the bug that added a "push hl" at the end of a program, for some reason.
Hopefully more are coming soon, at least I will try to finish it as soon as possible :D
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 Compiler

Message non lude PT_ » 01 Oct 2016, 19:36

Last week I made insane progress, tbh. I've implemented several commands, updated stuff, and of course, fixed many bugs. Let me point out the most important ones:
  • Disp - display both the result of an expression and a string, with only one Disp command! Example: Disp A+3,"ICE"
  • Pause - pauses the program for some time in ms. If you pause a number, like Pause 1337, it waits exactly 48000*number-1 ms (outside of interrupts/DMA)
  • If - exactly as you expected, If <statement>:<code>:End, no need for a Then, also not for a single line between the If statement and If
  • Repeat - again as you expected. Repeat <statement>:<code>:End repeats executing <code> until <statement> is true. <statement> will be checked after <code> (post-test)
  • While - same as Repeat, but then pre-test, just like BASIC
  • ClrHome - clears the homescreen, this is important before you display stuff
  • Input - a full routine to input a variable. Valid syntax is Input <variable>. Because the size is pretty large, this routine will be copied to the program data and called from the main program. Nothing is displayed in front of the input, that will come later
  • For - wow, not recommend to do that :P Valid syntax is For(<variable>,<expression>,<expression>(,<variable/number>). The step-thing is important. If the token right afer the last comma (thus the first token of the step) is ~, then the variable goes backwards. You can add/substract either the value of a variable, or a number from <variable>, so this are the possible options: ~number, ~variable, number, variable.
  • I fixed a main bug in the statusbar, at the last token, it didn't display the line to the right of the screen, but some pixels of.
  • Both optimization and added again 1000 bytes or so, but nobody cares :)
  • A very little bit auto-optimization, only noticable in For-loops ;)
  • Disp displays numbers at the right of the screen
  • One small thing to keep in mind, that I still need 12 operators/booleans, and since = is not implemented, my code to check is A is even...: If A/2*2-A+1 :P
So basically, this was it, and thus time for a nice screenshot!
Image
Image
Oops, I see that the loop size is not 100% correct...

Things to do:
  • Cesium icon+description support
  • Operators
  • (custom) functions
  • Auto-optimization
  • Sprites, If/Else/End
  • MAYBE running assembly subprograms

So that's it! I hope you guys enjoyed it :D
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 Compiler

Message non lude Epharius » 01 Oct 2016, 19:56

Nice job PT_! I advise you to give a priority to operators like '='... I think it would be a little bit hard to make a program whitout them :p
Good luck ;)
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 Compiler

Message non lude PT_ » 12 Oct 2016, 22:25

Sorry for the delay, school and other things were taking my time. But whatever, I can finally say ICE sees the finish line! I've finished all the operators/booleans + big optimization (14000 -> 11000 bytes :P), fixed some stuff with functions, and fixed the function ReadByte(). In fact ICE v1.2 will already work, but when you use another custom tokens, it will generate an error (not a crash!), so basically I'm coming in the stage of both test/debugging and eventually adding/fixing functions. Stay tuned!
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 Compiler

Message non lude Adriweb » 12 Oct 2016, 22:57

Pretty cool :D

Now/Soon you can start fuzzing (Try (or make a script to generate) some more-or-less random inputs to ICE) it to try to make it crash so you can fix some issues :P
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: 14616
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

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.
1492 utilisateurs:
>1444 invités
>43 membres
>5 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)