The shoutbox is currently out of service. Join us on Discord instead.
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 1 Guest are viewing this topic.

Snektron

Does ICE support negative values?
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ 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.

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

DJ Omnimaga

What's the maximum string length?

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

DJ 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. :)

Unicorn

So are there memory leaks with those gotos? And why make the code so confusing? Why not multiple if's for the checking?



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

DJ Omnimaga

Maybe he was just demonstrating Goto? Sometimes tutorials make useless code purposely to showcase one command in particular.

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?
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?
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ 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.

Snektron

I don't think this is supposed to happen
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Powered by EzPortal