### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Messages - PT_

Pages: 1 [2]
16
##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC
« on: June 01, 2016, 01:13:18 pm »
I DID IT!!!!!!!!!

I'm so happy now I succesfully compiled a normal program, without any errors

Ofc, I've finally a gif for you guys!

The program is still far from perfect, but I'm more than happy with this now

EDIT:

17
##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC
« on: May 28, 2016, 04:50:23 am »
I'm very happy to say that parsing a mathematical expression is almost done!
It now 'chains' operators, i.e. A*B+3, instead of the seperate routines for A*B and A+3 for example. Out of the 14 booleans/operators (+ - * / or xor and -> => <= > < = !=) I've finished 10. I only need >= <= > < to do, and after that, I'm ready with parsing such string (yet without functions). I haven't implemented auto-opt yet, but I will definitely do. Here is an example of what it can do:
String = A+4*B/(1-C)+3
Output =
Code: [Select]
ld a, ($D05301) ; Badd a, aadd a, apush af ld a, 1 ld hl,$D05302  ; C sub a, (hl)pop hlld l, 1mlt hlcall _DivHLByAld a, lld hl, $D05300 ; Aadd a, (hl)add a, 3retThe only good optimization I see is replacing the "push af" with "ld h, a" and remove the "pop hl". 18 ##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC « on: May 17, 2016, 01:25:12 pm » The 84 and 84CE BASIC are pretty similar. How hard would it be to port this the 84? I don't have any color calcs but this would be really cool! I don't know how different the z80 and the ez80 chips are though... Either way great work! That is what we have Axe Parser for If there wasn't something like Axe, the processors are totally different, so porting this would be the same as starting from scratch. 19 ##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC « on: May 17, 2016, 05:29:28 am » Small post despite my final exams: I've 'implemented' an API. That is, when running ICE from an ASM program, it will skip the header and directly search and compile the program. An example would be this: Code: [Select]  ld hl, ICEname call _Mov9ToOP1 call _ChkFindSym ex de, hl ; skip header inc hl inc hl push hl ; save for later ld hl, varname call _Mov9ToOP1 pop hl ld (callAdress), hlcallAdress =$+1  call \$000000  ; continueOf course, you can modify it for your own, but the program name should be in OP1 and to skip the ICE header, increment twice the starting data point.
My ICE program would look like this:
Code: [Select]
  jr noAPI  jr APIContinuenoAPI:  header....APIContinue:  call _ChkFindSymetc

20
##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC
« on: April 01, 2016, 02:01:42 pm »
While I had much free time today, I've implemented the operators in the Shunting Yard Algorithm in ASM, including their precedence. It now builds 2 stacks, one at (saveSScreen), the other at (saveSScreen+1000), one for the actual stack, and the first one for the output, which I need to read after that. Unfortunately, I have no screenshots of that
I hope to make good progress these weeks!

21
##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC
« on: March 31, 2016, 05:13:07 pm »
Today I've started creating an image, as for the homescreen of the ASM port, and as a logo for my documentation. This is the result:

Do you like it? Wanna change something?

22
##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC
« on: March 30, 2016, 02:50:16 am »
Sounds pretty snazzy, good luck!
Thanks!

While I had some free time, I wrote some pseudocode for the main algorithm, evaluating a mathematical expression. You can find it here.
And I have a question for you: what is the best code to represent the BASIC " and "? Let's say I have 3 in register A and 0 in register B, how can I know if both registers are not zero? Just "and b" doesn't work, because if you have 1 in A, and 2 in B, the result is still 0 :|
Any help is appreciated!

23
##### TI Z80 / Re: ICE - an interpreter/compiler of CE-BASIC
« on: March 26, 2016, 06:00:35 am »
Hi PT_!

Programmers (of any sort) will always be welcome to Omnimaga (questionably 'simply the best', hehe!). I'm a somewhat oldish guy that happens to have done a lot of Z80 work in past, from OSes development to IDEs (no games, tho), but oh well, that was like 30 years ago and let's say I'm not in the mood anymore to return to that programming model.

That said, I'm aware that many, mostly young people, still like to program for that hardware platform. Mind you, there are also quite a few around here, so, I must admit that Z80 (or direct derivatives: ez80 or an ARM emulating a z80) is/are still very popular. And "against evidences there are no (plausible) arguments", period! An 'old saying', BTW.

Your nick 'PT_' also took me a bit by surprise, probably you don't know (?) that 'pt' suffix is the Portugal internet country code (Yeah, I'm Portuguese, but I've also spent a couple of years in Holland. By now, I already know that your are 'a sweet Dutch boy'  ).

Well, all this talk just to say hello to you seems a bit much to me. I'm not going to dive into the technical advantages of your proposal for now, but I want to wish you good luck with your project and 'Tot ziens'.
I would say "Dank u wel!" for your response
Probably you saw this post on CodeWalrus too? I'm indeed a sweet Dutch boy, 17 years old, and I love programming and math. PT are the shortcuts of my full name  and because I think a username with 2 letters is too small, I added the _
Anyway, I hope to make good progress with this project in the next weeks!

24
##### TI Z80 / ICE Compiler
« on: March 25, 2016, 04:21:23 am »
Hello everyone!

I can imagine many, many people are waiting for this post, but yeah, one must be the first to start such project
I want to introduce this program:

ICE - an interpreter/compiler of CE-BASIC

Hooray! It would look like Axe Parser, but then for the newest calculator, the TI-84+CE.
Now are there many people who have questions, about what is possible with it, how long would it take to complete, what are the pros/cons?

What is ICE?
ICE is an interpreter/compiler of CE-BASIC. Normally, the OS reads a BASIC programs, and compiles it to some ASM commands, and then execute it. ICE does almost the same, but only read it, and compiles it to ASM commands, but instead of executing, it stores them into another program! In that way, you can turn your BASIC program into an ASM one, which is 1000x faster.

Why ICE?
Because I want to make a cool project (and not only games), and I think this program would be very useful for many people, so I decided to give it a try

What is possible with ICE?
I've no details yet, because I'm in an early stage, but I want to make it possible to keep it as BASIC as possible. I mean, you should be able in the future to compile all the BASIC programs to ASM. I never gonna reach that.... Like Axe Parser, it doesn't work with the TI-OS variables, because they are sloooowwwww. Instead, all the variables are in the RAM.

What are the pros and cons of ICE?
You can compile almost all the BASIC programs to ASM, which is 1000x faster. Since the CE has a memory-mapped screen, I'm going to implement a bunch of graph routines as well. A disadvantage is that you're a bit limited with the BASIC commands. I hope I can explain this later

When will you finish it?
In these weeks, I'm busy with school stuff, so I can't really do something with programming. But after that, I hope to finish it as fast as possible. Depending on the difficulties, I hope to finish it in some monts

How works ICE?
The hardest part is to express a string (and eventually store it to a variable). I will implement the Shunting-Yard-Algorithm for that (I will explain later). Once I got that ready, I need to write routines that replaces BASIC commands, like ClrHome would be call _HomeUp / call _ClrTxtShdw or whatever. Once THAT is ready, or enough of them, I will release a beta 

How smart is ICE?
For now, it is pretty smart, and by "smart" I mean, that if you display 2 strings which are exactly the same, it will be only once in RAM, an example:
Code: [Select]
Disp "ICE","ICE"would be this:
Code: [Select]
   call _NewLine   ld hl, _pointer_disp_0   call _PutS   call _NewLine   ld hl, _pointer_disp_0   call _PutS   ret_pointer_disp_0:   .db "ICE", 0which saves some RAM.

Example of Shunting-Yard-Algorithm:
Let's say I have this code:
Code: [Select]
F/2+3->AThe algorithm converts this to:
Code: [Select]
F 2 / 3 + A ->Now I gonna read this sentence, and convert it to this (for example code)
Code: [Select]
   ld a, (address_of_variable_F)// Now I now that I need to divide A by 2, which is a power of 2, so just rotate the byte   or a   rra// Now to add 3, which is a value, not a variable   add a, 3// Now store it to variable A, so   ld (address_of_variable_A), a`This is basically how the algorithm works, but then a bit more complicated especially when you have a long string.

Progress:
As some of you may know, it's very hard to work in ASM . That is why I decided to first create this in PHP (that's why I asked how to read .8xp with PHP). After I finished that, I will port it to ASM. I'm now in the stage for developing the Shunting-Yard-Algorithm, which is the main and hardest part.

I know,  there are still a ton of questions, so feel free to ask anything if you don't understand it, or whatever you want to say!

Originally posted on Cemetech: https://www.cemetech.net/forum/viewtopic.php?t=12616&highlight=

Pages: 1 [2]