mr womp womp wrote:
PT_ wrote:
☑ Custom name, after {i}, max length of 8

Pretty easy to implement Wink

Could you elaborate on this please? I don't know what has just been implemented Evil or Very Mad
Is this regular basic or a something you've added in?

KermMartian wrote:
It looks like you didn't post about it in this thread yet; on IRC, you proposed the following two possible header formats, where {i} is the imaginary i, sqrt(-1):
Code:
{i}PROGNAME

{i}PROGNAME DESCRIPTION OF MY PROGRAM
To make it easier to detect whether a program is ICE source code, and to make it easier for you to parse descriptions to boot, I propose:
Code:
{i}PROGNAME

{i}PROGNAME
{i}DESCRIPTION OF MY PROGRAM
In fact, you might want to consider a third option as well:
Code:
{i}PROGNAME
{i}DESCRIPTION OF MY PROGRAM
{i}DCE ICON

Wink
☑ Use ix for accessing variables - saves on average 6cc and 1.2 bytes each
☑ getKey
Almost done: rand, pretty easy to implement now.

And still bugfixing... Razz
PT_: Does your penultimate post mean you implemented the header that I recommended? If so, hooray! Good luck on the bugfixing.
KermMartian wrote:
PT_: Does your penultimate post mean you implemented the header that I recommended? If so, hooray! Good luck on the bugfixing.

Only the username for now, description and icon comes later.

For anyone who wants to see good speed:

vs

Size without header: 23 bytes vs 56 bytes. Pretty good, right?
I assume that's a Disp plus a loop? Can you compare the speed to the equivalent TI-BASIC program?
KermMartian wrote:
I assume that's a Disp plus a loop? Can you compare the speed to the equivalent TI-BASIC program?

Yep; the upper one is BASIC, the lower one is compiled. For a real speed difference:

Code:
1->A
ClrHome
While A
Disp A+B+C
A+1->A
End

ICE compiled program: 11.36 seconds - 60 bytes (could be optimized to 58 bytes, by using a jr, instead of jp)
BASIC program (to A=255): 26.65 seconds - 23 bytes
PT_ wrote:
ICE compiled program: 11.36 seconds - 60 bytes (could be optimized to 58 bytes, by using a jr, instead of jp)
BASIC program (to A=255): 26.65 seconds - 23 bytes

With the CE's new expanded memory, I'd say that the compiling is definitely worth it, as the size isn't as much of an issue as it was in earlier calculators.
Those are very promising results, The CE is already substantially faster than older models, so compiling programs would be a good alternative for long loopy tasks!
☑ Pause <expression> in ms, 1-256 ms (0=256 ms)




Already fixed some bugs Wink
Oki, some *big* updates from me:
- located the program data at UserMem, no need to calculate offsets. it jumps to the actual data of ICE with this routine:

Code:
start:
   ld hl, ICEName
   call _Mov9ToOP1
   call _ChkFindSym
   ld hl, ICEStart-start+4                           ; skip this pc routine + 4 bytes size+header
   add hl, de
   jp (hl)
ICEStart:
Now I can mess up UserMem easily
- the variables are now located at $E30800, which has 2 wait states, instead of 3, and thus you can save 1cc each time you get a variable Smile
- implemented IS>( and DS<( for respecitively incrementing and decrementing variables Very Happy
- another method for jumping to a function routine. Not a bunch of "cp XX \ jr nz, +_" but a jump table. Much easier for adding functions.
PT_ wrote:
- implemented IS>( and DS<( for respecitively incrementing and decrementing variables Very Happy

Do they work like the original IS>( and DS<( commands or do they just in/decrement the variables?
mr womp womp wrote:
PT_ wrote:
- implemented IS>( and DS<( for respecitively incrementing and decrementing variables Very Happy

Do they work like the original IS>( and DS<( commands or do they just in/decrement the variables?

Only in/decrementing variables. Almost nobody uses the original IS>( and I think it's useless Wink (saves 17cc)

Other note: saved 500 bytes by removing unnecessary stuff and optimizing Very Happy
Awesome, I think it was more commonly used on older calcs before for loops were added in, but now, the original IS>( and DS<( commands are indeed pretty useless, I can't really think of a good place to use them. I think it's better to just use them to increment vars, but once compiled, wouldn't it come back to exactly the same thing as doing A+1->A?
mr womp womp wrote:
Awesome, I think it was more commonly used on older calcs before for loops were added in, but now, the original IS>( and DS<( commands are indeed pretty useless, I can't really think of a good place to use them. I think it's better to just use them to increment vars, but once compiled, wouldn't it come back to exactly the same thing as doing A+1->A?

Yes, exactly, but with one difference:
A+1->A:

Code:
ld a, (ix) \ inc a \ ld (ix), a

IS>(A:

Code:
inc (ix)

It's both smaller and faster.


EDIT:

Compile archived programs: Very Happy
Pretty easy, but meh



Good news: Lbl/Goto works
Bad news: Lbl/Goto doesn't work




EDIT: it works now fine. I declared the pointer to the compiled program name as a 1-byte integer, while it should be a 3-byte integer Wink Also, no memory leaks!
NEW UPDATE: Disp <string>
It builds ANOTHER (Sad) 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 Sad

Size: source = 31 bytes.
Compiled program = 64 bytes. Pretty good Smile
And... I think this is double-post-worth Smile :
ICE v1.1 is ready! Input, Lbl/Goto and Disp <string> now works too!
Here's an example program:



Code:
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 Very Happy Very Happy Very Happy

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! Smile
Okay..... IT'S FINALLY READYYYYYY Smile Smile Very Happy
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


I'd be very interested to see quantitative measurements of that speedup, for trivial and nontrivial ICE vs. TI-BASIC programs. As I said, I'm planning to play with this tonight or tomorrow morning to see how it has come along.
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 Smile

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! Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, 4, 5, 6 ... 31, 32, 33  Next
» View previous topic :: View next topic  
Page 5 of 33
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement