* 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 37077 times)

0 Members and 1 Guest are viewing this topic.

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE Compiler
« Reply #375 on: July 17, 2017, 03:32:53 pm »
I had finally a free day off, which means I had a lot of time for programming :D

Today, I added Asm(, ReturnIf, remainder(, Lbl, Goto, Output( and Disp. The days before, in my spare free time, I added strings + string concatenation (like "ABC"+Str1) and length(. I have the framework done for sub( and toString(, both will be implemented soon :)

As far as I know, this is my to-do-list until the first C version release:
  • Integer types and pointers
  • sub(, toString(
  • For( loops
  • prgmX
  • DefineSprite(, ExecHex(, Call , CompilePrgm(, SetBASICVar(, GetBASICVar(
  • Eventually some sort of lists/data ish
  • More C functions
  • More random functions
If you have suggestions on what to add more, feel free to nag me, I'm now in the mood for adding things :)

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 Compiler
« Reply #376 on: August 14, 2017, 06:45:41 pm »
I'm kinda late but have you gotten any luck adding any of the above features since your post, especially pointers?
  • 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 Compiler
« Reply #377 on: September 04, 2017, 03:30:46 pm »
Good news! I added GetPixel( in the ASM version! :D
It's still a bit primitive, the syntax should look like this:
Code: [Select]
det(7,<expression>,<expression>)-><variable>. You do need the closing parenthesis, otherwise it won't work.

Download: https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/programs/ICECompiler.zip


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 Compiler
« Reply #378 on: September 06, 2017, 12:16:07 pm »
GetPixel will be very handy o.o . I remember many games in the past used such collision detection. Can it pixel test from both VRAM?
  • 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 Compiler
« Reply #379 on: September 06, 2017, 01:14:58 pm »
Yes, it's the same as the C lib function, so it should work fine.

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE Compiler
« Reply #380 on: September 27, 2017, 12:27:35 pm »
I'm ready with implementing everything, so it's time for bugtesting. I've tested all the non-expression functions, like If, Repeat, Call etc.
Also, it seems the icon and description works :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 Compiler
« Reply #381 on: September 27, 2017, 05:47:32 pm »
Yay, icons! Maybe someday I should update Opossum Massage Simulator so that it features highscores and an icon.
  • 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 Compiler
« Reply #382 on: September 27, 2017, 07:18:24 pm »
Yay, icons! Maybe someday I should update Opossum Massage Simulator so that it features highscores and an icon.
I bet that OMS is now 5% smaller due to more heavy optimizations in ICE :P Anyway, I'm planning to add tilemaps soon, and then the final bugtesting can begin, which means the C version will probably be released within some weeks.

Offline _iPhoenix_

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 475
  • Post Rating Ratio: +9/-1
  • █████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • @the-legend-of-iphoenix
  • Gender: Male
Re: ICE Compiler
« Reply #383 on: September 27, 2017, 09:06:45 pm »
How does Cesium know that an ice program is written in ice, not assembly?
  • Calculators owned: A sentient TI-84+ CE, TI-85
  • Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Help me with a project by voting here! Thanks!

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 230
  • Post Rating Ratio: +21/-1
Re: ICE Compiler
« Reply #384 on: September 27, 2017, 09:36:52 pm »
How does Cesium know that an ice program is written in ice, not assembly?
The same way it knows a C program is written in C not assembly. ;)

Offline _iPhoenix_

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 475
  • Post Rating Ratio: +9/-1
  • █████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • @the-legend-of-iphoenix
  • Gender: Male
Re: ICE Compiler
« Reply #385 on: September 27, 2017, 10:13:42 pm »
How does Cesium know that an ice program is written in ice, not assembly?
The same way it knows a C program is written in C not assembly. ;)

I thought so. (That was actually more help than it may have seemed.)
  • Calculators owned: A sentient TI-84+ CE, TI-85
  • Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Help me with a project by voting here! Thanks!

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me

Offline PT_

  • Full User
  • Join Date: Mar 2016
  • Location:
  • Posts: 276
  • Post Rating Ratio: +12/-0
Re: ICE Compiler
« Reply #386 on: September 29, 2017, 07:47:13 pm »
I'm finally done with bugtesting, at least all my test programs work fine (during testing I solved another bug or 2), so it's time to share it with you guys. Feel free to download this ICE, please test all the edgy cases, and if there's an ICE ERROR: Please report it, please send me your source code, then I can try it as well :)

Things I still want to fix but that are not really important:
- Max label/variable name length
- More syntax errors at impossible cases
- All the remaining bugs lol

https://www.dropbox.com/s/ehk81xwu4foeil8/ICE.zip?dl=0
 
There is an .exe in the folder, it works exactly the same as the C version. Just run it with
Code: [Select]
ice <input program>, i.e.
Code: [Select]
ice SUM.8xp, and it will compile your program and output the program in the main directory. I know, I still need to rewrite the entire commands.html and documentation.pdf, but will do that later, so you guys have to do it without documentation ;)
Let me explain the most important changes, some others should be straightforward:
- Pointers. *{ } for 1-byte dereference, **{ } for 2-byte dereference and ***{ } or just { } for 3-byte dereference. The amount of nested { } is the level, so {{A}} gets the word at address at word at address A.
- Copy( copies arg3 bytes from arg1 to arg2. If there are 4 arguments, the first argument will be ignored, but the copy will be reversed (lddr instead of ldir)
- Data( returns a pointer to the data section in the program data. First argument should be the size of the next elements (1 = 8-bits, 2 = 16-bits, 3 = 24-bits). All the remaining elements will be inserted in the program data and it returns a pointer to this.
- L1-L6 are now pointers, so accessing the first element of L1 will be ***{L1+0} instead of L1(0).
- Alloc( allocated some memory, for example for rotating or enlarging sprites. Returns a pointer to the data.
- sum(... all the same as det(, but sum( is used for the FILEIOC lib. Sorry, won't show all the arguments needed, but you can select the right function in the program editor by pressing [TRACE].
- sin( cos(, range is [0, 255] (so 256 = 2*pi)
- String concatenation, storing, displaying
- for displaying a new line

And much more which I can't tell now. But have fun exploring ICE, and hopefully I can make it an official release soon! :D
« Last Edit: September 29, 2017, 08:26:45 pm by PT_ »

Offline _iPhoenix_

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 475
  • Post Rating Ratio: +9/-1
  • █████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • @the-legend-of-iphoenix
  • Gender: Male
Re: ICE Compiler
« Reply #387 on: September 29, 2017, 11:36:34 pm »
so {{A}} gets the word at address at word at address A.

So it goes to the location stored in pointer A, gets the location stored there, and returns what it finds at the location?

Edit: I may be able to help with/do the commands file, if you want.
« Last Edit: September 29, 2017, 11:38:35 pm by _iPhoenix_ »
  • Calculators owned: A sentient TI-84+ CE, TI-85
  • Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Help me with a project by voting here! Thanks!

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 230
  • Post Rating Ratio: +21/-1
Re: ICE Compiler
« Reply #388 on: September 29, 2017, 11:47:19 pm »
so {{A}} gets the word at address at word at address A.

So it goes to the location stored in pointer A, gets the location stored there, and returns what it finds at the location?

Edit: I may be able to help with the commands file, if you want.
I think you are along the right lines. There is still a lot of confusion I feel on the difference between words and pointers; so here's how it works really quick: (Let's assume the variable A holds the value 5).

A is a pointer to an address, in this case 5.
{{A}} Returns the pointer stored at address 5. Let's say at address 5 this pointer holds the value 10.

So 30->*{A} would store the 1-byte value 30 to address 5.
But 30->*{{A}} would store the 1-byte value 30 to address 10.

Offline _iPhoenix_

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 475
  • Post Rating Ratio: +9/-1
  • █████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • @the-legend-of-iphoenix
  • Gender: Male
Re: ICE Compiler
« Reply #389 on: September 30, 2017, 12:03:45 am »
That’s what I meant.

I’ve read enough Assembly topics that I knew it was possible to do so, and inferenced (that’s a word, right?) my post from the info in those threads.

Multi-level pointers are things I never knew existed, but desperately need...
  • Calculators owned: A sentient TI-84+ CE, TI-85
  • Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Help me with a project by voting here! Thanks!

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me

 


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