* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: ICE Compiler  (Read 37037 times)

0 Members and 2 Guests are viewing this topic.

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 230
  • Post Rating Ratio: +21/-1
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #15 on: March 26, 2016, 05:01:06 pm »
I'm not really a fan of how everything is just spewed in one directory, and not in some proper folder like src/ and build/. I made my own makefile for that but it broke.
Ah, that totally makes sense :) I dislike that a lot too; I see what I can fix about it :)

Also the register thing had nothing to do with the SDK. It had to do with the way i wanted to do expression compiling, where + and - would operate on hl (so you could use
add hl, bc and sbc hl, bc). * and / would operate on BC, so you could use something like call mul_bc_de. Then the constants would get loaded into de.
It would produce quite short code, but i also wanted to use the RTL functions, where __imuls takes arguments hl and bc and thus ruining my algorithm :(
Ah, yeah, that sounds rather difficult :( Pretty neat idea though, sounds like it would be quite nice :)

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #16 on: March 31, 2016, 09:12:35 pm »
Today I've started creating an image, as for the homescreen of the ASM port, and as a logo for my documentation. This is the result:



Do you like it? Wanna change something? :)

Offline Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2823
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #17 on: April 01, 2016, 06:34:55 am »
That looks pretty nice!
Maybe get rid of the Options:  text? It seems a bit unnessicary
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3165
  • Post Rating Ratio: +32/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • quantuminfinity
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #18 on: April 01, 2016, 09:30:47 am »
That looks pretty awesome! Good job :)
Meanwhile i've also thought of more complexities: formula's like (a + b) / (c + d) aren't possible without a stack :(
(actually this one is, but formula's can always be expanded for more complexity :P)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #19 on: April 01, 2016, 11:21:27 am »
That looks pretty awesome! Good job :)
Meanwhile i've also thought of more complexities: formula's like (a + b) / (c + d) aren't possible without a stack :(
(actually this one is, but formula's can always be expanded for more complexity :P)
Thanks :)
You have 2 ways to 'save' temporary data. One is indeed pushing the value on a stack, the other is just loading it in another register, which won't be used until that value will be used. Then you only need an algorithm to check whether you use that register. On another side, I've started porting this to ASM, and I have the numbers ready, and being busy with operators :)

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #20 on: April 01, 2016, 06:01:05 pm »
While I had much free time today, I've implemented the operators in the Shunting Yard Algorithm in ASM, including their precedence. It now builds 2 stacks, one at (saveSScreen), the other at (saveSScreen+1000), one for the actual stack, and the first one for the output, which I need to read after that. Unfortunately, I have no screenshots of that :(
I hope to make good progress these weeks! :thumbsup: :)

Offline Jkolade936

  • All Around Coolio
  • Super User
  • Join Date: Jan 2016
  • Location: Horseheads, NY
  • Posts: 1515
  • Post Rating Ratio: +9/-1
  • I'm an unknown loner. I try to change that.
    • Jkolade936
    • My Sprites and Walrii Collection
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #21 on: April 01, 2016, 07:53:23 pm »
Yay! Progress!
Keep up the good work!  :thumbsup:
  • Calculators owned: None of them. :'(
Does this qualify as a signature? 
The answer is "Sure."


Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18782
  • Post Rating Ratio: +96/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #22 on: April 02, 2016, 05:42:38 am »
Today I've started creating an image, as for the homescreen of the ASM port, and as a logo for my documentation. This is the result:



Do you like it? Wanna change something? :)
I like it, but I was shocked by a post on Cemetech when you said the image alone was 70 KB large. O.O That's nearly half of the calculator RAM, so if program code has to be edited from RAM, then that leaves about 35 KB left for games >.<

That's unless you use compression or that the image is an april fools joke, though. You could perhaps reduce the quality and amount of colors and implement compression? This title screen looks nice, though. Also I'm glad to see new progress. :) On a side note, will this language compiler be in pure ASM or will it use both C and ASM?
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #23 on: April 02, 2016, 07:20:22 am »
Today I've started creating an image, as for the homescreen of the ASM port, and as a logo for my documentation. This is the result:



Do you like it? Wanna change something? :)
I like it, but I was shocked by a post on Cemetech when you said the image alone was 70 KB large. O.O That's nearly half of the calculator RAM, so if program code has to be edited from RAM, then that leaves about 35 KB left for games >.<

That's unless you use compression or that the image is an april fools joke, though. You could perhaps reduce the quality and amount of colors and implement compression? This title screen looks nice, though. Also I'm glad to see new progress. :) On a side note, will this language compiler be in pure ASM or will it use both C and ASM?
Yep :( Maybe I could go in 4bpp, which takes 'only' 35Kb or RAM, or even in 2pp, which takes still 17Kb. (NO April fool!) The compiler will be in pure ASM. :)

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18782
  • Post Rating Ratio: +96/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #24 on: April 02, 2016, 07:23:40 am »
What about making the background 160*240 and stretching it horizontally? Or even 160*120. You don't need much details, since it's ICE content that matters. :)
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3165
  • Post Rating Ratio: +32/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • quantuminfinity
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #25 on: April 02, 2016, 08:51:38 am »
You could also make a special blue palette for it
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18782
  • Post Rating Ratio: +96/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #26 on: April 02, 2016, 06:29:53 pm »
Yeah that could work. I heard that lower bit modes are palette-based, so quality would not suffer much. Or you could store the bg in archive and read it from there when the title screen is loaded. The compiler would not be in one single file, but I bet people wouldn't mind much.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #27 on: April 08, 2016, 08:52:25 pm »
I'm very happy to say that I got the Shunting Yard Algorithm ready, for parsing the input to RPN notation, which is much easier for compiling. It builds 2 stack, at saveSScreen and saveSScreen+1000, each entry of 2 bytes, one for the type, and the other one for the token itself (yet no 2-byte tokens). These commands are already included:
Code: [Select]
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZtheta+-*/,()and also the functions, like sin(, cos( etc.
Again, I'm really sorry to don't have screenshots yet, tomorrow I hope to work on parsing RPN notation. Be patience! :)
In the meantime, has someone a good code in ASM to get all the programs or should I write it myself?

NOTE: ^ has in ICE left-associativity, if-you-know-what-that-means-but-no-one-cares :D

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18782
  • Post Rating Ratio: +96/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #28 on: April 09, 2016, 04:48:47 am »
Nice PT_. Just one thing, though: Does it mean we will not be able to program in algebraic mode? Also I am unsure if I understand what you mean by left-associativity. D:
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE - an interpreter/compiler of CE-BASIC
« Reply #29 on: April 09, 2016, 06:58:40 am »
Nice PT_. Just one thing, though: Does it mean we will not be able to program in algebraic mode? Also I am unsure if I understand what you mean by left-associativity. D:
No, you just program like you always did qua mathematical expressions, such as 5*(2+3)-3. ICE will convert it to RPN notation, because parsing RPN notation is much easier (search Google for Infix->postfix). For Left-associativity, I will give you an example. When you calculate 1*2*3, you calculate (1*2)*3. Officially spoken, when you calculate 2^3^4, you calculate 2^(3^4) which is 10^24, because the ^ has right-associativity. But in the program editor, if you type 2^3^4, the TIOS will calculate it as (2^3)^4 which is 4096. ICE will do the same, such that 2^3^4 = (2^3)^4.
Hope this helps! :)

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games