Author Topic: ICE Compiler  (Read 22438 times)

0 Members and 1 Guest are viewing this topic.

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #15 on: May 28, 2016, 04:50:23 am »
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]
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".

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #16 on: May 28, 2016, 12:27:03 pm »
Sounds cool!
Congrats on getting this far on a project that (seems) really difficult!
I'm still around... kind of.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #17 on: May 28, 2016, 03:30:24 pm »
Wow, fantastic!

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #18 on: June 01, 2016, 01:13:18 pm »
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!


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

EDIT:

« Last Edit: June 01, 2016, 01:26:46 pm by PT_ »

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #19 on: July 02, 2016, 02:34:41 pm »
Version 1.1.0: July XX, 2016
   ☑ Custom compiled program name
   ☑ Compile archived program
   ☑ getKey, rand
   ☑ Pause
   ☑ Direct incrementing/decrementing variables
   ☑ Changed accessing variables using ix, located at $E30800
   ☐ Input
   ☐ Lbl/Goto
   ☐ Display strings

Offline neuronix

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 108
  • Rating: +0/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #20 on: July 04, 2016, 10:17:54 am »
I good feature for disp function:
    if the string contain i (the imaginary i), the string placed after this character is puted at a new line ;)

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #21 on: July 05, 2016, 04:33:37 pm »
ICE v1.1 is ready! Input, Lbl/Goto and Disp <string> now works too!
Here's an example program:


Code: [Select]
rand->A
Repeat A=B
Input B
If B>A
Goto TOOHIGH
Disp "TOOLOW"
Goto GETNEXT
Lbl TOOHIGH
Disp "TOOHIGH"
Lbl GETNEXT
1->C
While C
IS>(C
Pause 5
End
End
Asm(CD8C0D02     // call _GetKey
Disp A
Pretty good, right? Size = 104 vs 211 bytes. WOW :D :D :D

I can't say it's bugless (notice the wrong value of A at the end), but yeah, I'm super happy with this. I hope to upload it very soon! :)

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #22 on: July 07, 2016, 04:14:02 pm »
Okay..... IT'S FINALLY READYYYYYY :) :) :D
Compiling is now much easier (not faster), and better understandable.
Download:
https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/ICE.zip
https://tiplanet.org/forum/archives_voir.php?id=587211

"ICE Compiler is a program that compiles TI-BASIC-like language to ASM, the machine code. Create insane games, use the color screen, and make the step to ASM smaller! Speed up your BASIC programs and it's super easy to use! Type your program in the normal editor, compile it within seconds, and you have hours of fun! It doesn't require any shell."

Have fun and don't hesitate to post anything!

Also, it will be open-source, I will upload it soon to GitHub



Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #23 on: July 07, 2016, 07:47:02 pm »
Looks really awesome!  :o
If I ever get a color calculator Ice is definitely going on it!

Is it finished or will there be more updates? (besides bugfixes)
 ;D
I'm still around... kind of.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #24 on: July 08, 2016, 01:45:19 am »
Yesss, this is looking quite awesome indeed!
do you plan to add built-in functions for drawing sprites and thelike?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #25 on: October 22, 2016, 01:29:01 pm »
Time for a M-M-M-M-MONSTER bump!

So I'm currently busy with a really big update, ICE v1.2, and I want to show you the most important updates (I don't want to discuss each update, it should be self-explanotary :) )

  • 3-byte integers
  • GUI
  • C functions
  • GUI
  • For loop
  • List support
  • String support
  • Smoother compiling
  • If:Else:End
  • Call a label
  • Return
  • Remainder(
  • A little bit auto-optimization
  • not(
  • Pause (time)
  • Doubles the size (close to 15K now)
  • Multiplication with number <= 20 is now a special routine

There are even more updates, take a look at Cemetech, TI-Planet or CodeWalrus for more updates, screenshots and discuss points :)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #26 on: October 24, 2016, 08:06:27 pm »
Holy, crud, wow!

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #27 on: November 08, 2016, 07:07:30 pm »
So I'm super happy to announce that ICE v1.2 is finally released!
When it's being accepted, you can download it at
https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/ICECompiler.zip
or directly at https://tiplanet.org/forum/archives_voir.php?id=587211

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #28 on: November 10, 2016, 12:34:39 pm »
Are you also going to upload to ticalc.org?
/e

Offline PT_

  • LV2 Member (Next: 40)
  • **
  • Posts: 24
  • Rating: +7/-0
    • View Profile