Join us on Discord!
You can help CodeWalrus stay online by donating here.

[TI-84+CE] ICE Compiler

Started by PT_, March 25, 2016, 08:14:17 AM

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

Snektron

Does ICE support negative values?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Quote from: PT_ on July 05, 2016, 05:26:38 AM
Quote from: DJ Omnimaga on July 05, 2016, 01:51:57 AM
Wait, did the Lbl/Goto bug mess up your VAT or something in that screenshot? I hope it did not corrupt anything archive-related, though. That would be bad if you hit the OS certificate by accident and bricked your calc O.O
No, not really. I accidentally set the pointer to the compiled program name to $DD47E1 or something like that. Why it would mess up? I dunno. Btw, I use CEmu and I can easily redownload it ;)
Ah ok lol. I was unsure, since it was possible to corrupt the TI-83+/84+ archive if you unlocked flash and did bad stuff.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: Cumred_Snektron on July 05, 2016, 10:39:00 AM
Does ICE support negative values?
Nope, yet not.

NEW UPDATE: Disp <string>
It builds ANOTHER (:() stack for the program data, and at the end it copies it to the end of the program, and update all the pointers. Standard size = 13+length_string, and I've no idea about the speed.

(Actually, that ":" should be a ".". There is a difference between characters and tokens :(

Size: source = 31 bytes.
Compiled program = 64 bytes. Pretty good :)

Dream of Omnimaga

What's the maximum string length?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: DJ Omnimaga on July 05, 2016, 06:47:38 PM
What's the maximum string length?
There is no maximum. Well, as long as vRAM is, maybe. But yeah, whould would like to display a string of 320*240*2 tokens? :trollface: 

PT_

And... I think this is double-post-worth :) :
ICE v1.1 is ready! Input, Lbl/Goto and Disp <string> now works too!
Here's an example program:


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! :)

Dream of Omnimaga

Cool. I assume that 1.1 is sitting in ticalc.org or Cemetech pending queue, right? I might give it a try if I'm not too busy with going out  in the next few weeks (yay $1 public transit promotion and extended service).

The size is not bad. Normally such language ends up twice larger than ASM but if it's quite efficient then I can live with it, just like with Axe. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

So are there memory leaks with those gotos? And why make the code so confusing? Why not multiple if's for the checking?
  • 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 ??? ??? ??? ??? ???



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

Dream of Omnimaga

Maybe he was just demonstrating Goto? Sometimes tutorials make useless code purposely to showcase one command in particular.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: DJ Omnimaga on July 06, 2016, 01:50:11 AM
Cool. I assume that 1.1 is sitting in ticalc.org or Cemetech pending queue, right? I might give it a try if I'm not too busy with going out  in the next few weeks (yay $1 public transit promotion and extended service).
Nope, I first want to test it all, and fix some bugs. After that, I will upload it :)
Quote from: DJ Omnimaga on July 06, 2016, 01:50:11 AM
The size is not bad. Normally such language ends up twice larger than ASM but if it's quite efficient then I can live with it, just like with Axe. :)
Indeed, and with the Goto's and Repeat/While, I can chop off 4 bytes by using a "jr" instead of "jp" but for now, I'm more than happy with it ;)
Quote from: Unicorn on July 06, 2016, 03:18:38 AM
So are there memory leaks with those gotos? And why make the code so confusing? Why not multiple if's for the checking?
No, there aren't any memory leaks. A Repeat looks like this: <code> \ or a \ jr z, <code>. A simple Goto is just a jump. So you will get <code> \ <jump> \ or a \ jr z, <code> which doesn't cause an overflowed stack, because there is no stack. And as DJ said, this example is just for showing what is possible, and I admit, it's pretty bad :trollface: 

Snektron

Does stuff like

A*3->B*6->C

work too?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


PT_

Quote from: Cumred_Snektron on July 06, 2016, 11:52:01 AM
Does stuff like

A*3->B*6->C

work too?
Sure :trollface:  that always saves space and speed:)

Snektron

Quote from: PT_ on May 18, 2016, 10:17:32 AM
Quote from: Cumred_Snektron on May 18, 2016, 09:49:28 AM
BTW, are you going to provide something similar to axioms?
I haven't thought about that, but that sounds like an incredible idea. Fantastic! Can you show me an example of how that works? What can an Axiom do and how would that look like?

I've only noticed this just now, but they're basically natives for Axe, allowing people to make commands and add tokens. Not sure how to implemente them, but m,aybe they could work with Libload?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Quote from: PT_ on July 06, 2016, 05:30:54 AM
Quote from: DJ Omnimaga on July 06, 2016, 01:50:11 AM
Cool. I assume that 1.1 is sitting in ticalc.org or Cemetech pending queue, right? I might give it a try if I'm not too busy with going out  in the next few weeks (yay $1 public transit promotion and extended service).
Nope, I first want to test it all, and fix some bugs. After that, I will upload it :)
Quote from: DJ Omnimaga on July 06, 2016, 01:50:11 AM
The size is not bad. Normally such language ends up twice larger than ASM but if it's quite efficient then I can live with it, just like with Axe. :)
Indeed, and with the Goto's and Repeat/While, I can chop off 4 bytes by using a "jr" instead of "jp" but for now, I'm more than happy with it ;)
Quote from: Unicorn on July 06, 2016, 03:18:38 AM
So are there memory leaks with those gotos? And why make the code so confusing? Why not multiple if's for the checking?
No, there aren't any memory leaks. A Repeat looks like this: <code> \ or a \ jr z, <code>. A simple Goto is just a jump. So you will get <code> \ <jump> \ or a \ jr z, <code> which doesn't cause an overflowed stack, because there is no stack. And as DJ said, this example is just for showing what is possible, and I admit, it's pretty bad :trollface: 
Can multiple loops or blocks be nested?


As for Axioms, you could always add support for inline ASM and have people type the hexadecimal inside the Asm() command or something.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

I don't think this is supposed to happen
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Powered by EzPortal