Page 6 of 24

Re: ICE Compiler

Unread postPosted: 07 Jul 2016, 19:17
by PT_
Okay..... IT'S FINALLY READYYYYYY :) :) :D
Compiling is now much easier (not faster), and better understandable.
The link to the download is in the first post of this thread, to find it easy.

"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

Image

Re: ICE Compiler

Unread postPosted: 07 Jul 2016, 19:30
by Adriweb
Awesome - Glad it will be on GitHub as well, this should prove both useful for development purposes with people being able to help/contribute, and for a teaching/earning perspective, since it's always nice to learn by example :)

Anyway, this should be newsable, though would probably require some more examples, list of things working currently, in the future, etc. (and a french version of the news article content, but we can do that :P)
BTW, do you have some comparison, for example, of a Basic version and an ICE version for an algorithm that takes a bit of time? It would be nice to be able to compare performance directly.

Also, I like the inline Asm(hex_here, much simpler than having to call another program :P

Re: ICE Compiler

Unread postPosted: 07 Jul 2016, 20:42
by PT_
Adriweb wrote:Awesome - Glad it will be on GitHub as well, this should prove both useful for development purposes with people being able to help/contribute, and for a teaching/earning perspective, since it's always nice to learn by example :)

Anyway, this should be newsable, though would probably require some more examples, list of things working currently, in the future, etc. (and a french version of the news article content, but we can do that :P)
BTW, do you have some comparison, for example, of a Basic version and an ICE version for an algorithm that takes a bit of time? It would be nice to be able to compare performance directly.

Also, I like the inline Asm(hex_here, much simpler than having to call another program :P

Thanks :)
Here is my global future list, not really good, but yeah :troll:
Code: Select all
Version 1.0: June 11, 2016   
   ☑ Adding, substracting, multiplication, dividing
   ☑ Parenthesis
   ☑ Booleans, comparisons
   ☑ Storing, variables
   ☑ Run inline ASM
   ☑ Display integers
   ☑ ClrHome
   ☑ If, Repeat, While
   
Version 1.1: July 07, 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
   ☑ Bugs fixed
   
Version 1.2: August XX, 2016
   ☐ Optional Cesium icon/description
   ☐ Sprites
   ☐ For(
   ☐ GUI
   ☐ Run assembly subprograms
   ☐ 24-bits integers support
   ☐ Text(
   ☐ Basic list support
   ☐ Better compiling
   ☐ If - Then - Else
   ☐ Call a label
   ☐ Return
   ☐ DoorsCE support?
   ☐ Auto-optimization
   ☐ Colored text, foreground+background

Maybe this is too much; then I will split it into more releases.

For the difference: I've showed one small difference at the Cemetech thread, please take a look over there :) Need more examples? This is almost just pure BASIC, no need to have examples, because there are enough BASIC tutorials. Only some main differences, like IS>(<variable> and Asm(<hexstring>. If you really need help or examples, I'm willing to make some ;)

Re: ICE Compiler

Unread postPosted: 08 Jul 2016, 14:26
by Ti64CLi++
Nice.
Very great job PT :bj:
For Text( command, do you plan to make color and big or small or inverted text?

Re: ICE Compiler

Unread postPosted: 14 Jul 2016, 21:58
by PT_
Time for some important notes/question.

As promised, ICE v1.1 is open source. You can download/view it at https://github.com/PeterTillema/ICE. There is currently no license, but please don't copy/share it, as normal. I hope to find a good one soon :)

I'm going abroad for about 3 weeks, so then I can't work on it.

I will split the main to-do-list in 2 parts. The first part is more focused on compiling, errors, and a good GUI. The second part is more focused on adding stuff, and customs tokens.

That said, about customs tokens, I have some interesting questions for you guys. First, let me explain how I want to do this. What I need: 3 hooks: GetCSC, Menu and Token hook. My goal was
1) check if you are in the program editor
2) if so, check if you pressed [TRACE]
3) if so, force the OS to being [PRGM] pressed
4) set a special bit
5) Menu hook -> bit set, my own menu with
6) customs tokens.

Now some questions:
- if you have the token hook, and you change DE (token number), would it still work somehow?
- when the OS displays a menu, and it reads a token to be displayed as an option, would the Tokenhook run?
- if you enable the recall queue in the program editor, and you insert a *non-existent* token for some reason, would it run the Tokenhook? (call _Get_Tok_Strng or call _GetTokStrng?)
- the Wiki says about the Tokenhook, that you can point hl to the string. Would it start with the string length, or should it be null-terminated?

Thanks in advance! :)

Re: ICE Compiler

Unread postPosted: 15 Jul 2016, 06:50
by Lionel Debroux
Even if there's no actual license yet, making ICE OSS is a good move :)

Between the WTFPLv2, the Apache/BSD/MIT/X11 family, the MPL, the LGPL, the GPLv2, the GPLv3, and other licenses less widespread and/or less relevant to source code, there's a huge amount of choice, spanning the whole range between "software is open source with strong usage + modification rights and really must stay that way" (GPLv2 / GPLv3) and "anyone can do anything with it, including make closed-source forks, sell them, use them to sue, register software patents, and whatever else, without giving back to the community in any way" (WTFPLv2 of course, but also pretty much BSD/MIT/X11).

Re: ICE Compiler

Unread postPosted: 18 Jul 2016, 15:36
by PT_
Well, the first step is made to my own custom tokens!!! (Btw, after inserting it in the program, it crashes :()
Image

Re: ICE Compiler

Unread postPosted: 19 Jul 2016, 13:24
by Adriweb
That's pretty cool :)
Reminds me of the Omnicalc ones ( http://www.detachedsolutions.com/omnica ... ctions.php first screenshot at the top )

Re: ICE Compiler

Unread postPosted: 11 Aug 2016, 11:31
by PT_
Thanks :)

Time for some updates. This week I came back from my holiday, which means I had some time for programming again. And yes, of course, I picked up ICE to start with, outside of some small projects. I'm currently working on 4 parts:
- GUI
- Optimization
- Auto-optimization
- Add custom tokens.

The first part, the GUI, is halfway done, I still need to get all the programs from the VAT, starting with [i], and display them, and of course select one. The second point is just underway, many thanks to grosged who gave me some tips, and now I can save about 100 bytes, maybe even more. I'm about to start with point 3, the auto-opt. For example I have this peace of code: Repeat A=5
ICE now compiles that into
Code: Select all
ld a, (ix+variableA)
sub a, 5
add a, $FF
sbc a, a
inc a
or a
jp z, ******

Well, it could be MUCH shorter!
Code: Select all
ld a, (ix+variableA)
sub a, 5
jp z, ******

This will be done at the auto-opt part, and I guess it can optimize much stuff! :)

Last part is the custom tokens, or a replacement of uncommon tokens. I've posted earlier how I gonna do that, and I'm only struggling with the extended keypresses for tokens.
Side note, I want to 'create' these tokens:
ExecHex(
Sprite(
Rect(
ReadByte(
ReplaceByte(
AddByte(
DeleteByte(
SetupPrgm(
CreateVar(
ArchiveVar(
UnArchiveVar(
DeleteVar(
Inc(
Dec(

Wanna see things added? Let me know, even if you have questions what they can do! :)

Re: ICE Compiler

Unread postPosted: 11 Aug 2016, 18:36
by Lionel Debroux
For this kind of on-calc code generators, you'll have to strike a balance between execution efficiency of the generated code, wrt. compile time and complexity of the compiler.

Re: another post elsewhere, where you mentioned at least 0xFF, 0xFE and 0xFC key codes: FWIW, the libticalcs list, itself extracted from ti83plus.inc or similar, is at https://github.com/debrouxl/tilibs/blob ... /keys83p.h . Not sure how complete / correct it is for the TI-eZ80 series, however :)