Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: squidgetx on December 16, 2010, 07:50:18 pm

Title: [idea] multi-page apps
Post by: squidgetx on December 16, 2010, 07:50:18 pm
Now, I know that everyone's all like: blargh imma wanting some of that multipage app goodness, and Quigibo's like....not practical.

If I understand correctly, it's not that compiling a multipage app is difficult because it's large, but it's that creating the instructions to swap pages and that knowing when and where to swap pages in an arbitrary program makes it difficult.

Now, simplifying, the problem would be would that the parser doesn't have enough information (that only the programmer would know) to accurately create the multipage app.

So my idea was, to have integrate a compiler command to indicate the different pages :| There would probably two commands, one to call the 2nd page and one that is some kind of modification to the #include (prgmXXX) function, where that program would be parsed into the 2nd page. Then, in the app's code, when the program needs to swap pages, there would just be some command in the 'mother app' to switch pages. For example, if you wanted to mix a battle engine (in prgmBATTLE) with a tilemapper, the code might look like this:
Code: (main program) [Select]
blah blah blah tilemapper code
<when a battle occurs>
instruction to swap to 2nd page of app
more code blah
...

instruction to parse prgmBATTLE as the second page of the app

Basically, what this could do would be to enable "packaging" of a second app together with the first app, sort of like what Builderboy's virtual-page program does, but only with real app pages. While this method would in no way be close to producing the flexibility of a real asm-programmed multipage app, I figure that this, well, it's better than what we have right now :P. It would require the programmer to make sure that his pages can run completely independently of eachother (no subroutines or anything), but that's a small price to pay.

Thoughts? Is this even possible?
Title: Re: [idea] multi-page apps
Post by: Hot_Dog on December 16, 2010, 07:56:12 pm
That's certainly an idea to consider
Title: Re: [idea] multi-page apps
Post by: jnesselr on December 16, 2010, 08:56:45 pm
The only problem is that the routine to swap the pages cannot be located on the page you're trying to swap.
Title: Re: [idea] multi-page apps
Post by: calc84maniac on December 16, 2010, 09:27:18 pm
The idea I had for multipage apps would be that you could have up to 16KB of code and unlimited data. The static pointers on other pages could be treated almost exactly like the file objects, I think (but static instead of variable, and relative page instead of absolute page)
Title: Re: [idea] multi-page apps
Post by: Quigibo on December 16, 2010, 10:50:26 pm
The best way to have multi-paged code is page calls.  On the main page, you write all your normal code.  But subroutines can be called off-page by special routines so perhaps they could be put on the other pages with the data.  The reason I can't do this though is that the parser simply doesn't have enough memory left to keep track of all the multi-page functionality.  The all data idea that calc84maniac is talking about seems like the only practical way at the moment.  And just for the record, the reason I haven't implemented this yet is actually because its difficult for the compiler.  Writing things to multiple pages of flash, additional parsing passes, creating new syntax, checking for errors, all while being compatible for all versions of calcs (which have different starting points for the app tables) is challenging and time consuming.  If there are any assembly programmers who want to help me with it, I can post the app writing code if you're up for it, but I can hardly understand it myself since about a third of it is written by TI.

This is why I think a computer version would be much more efficient.  But I think if I do end up doing that, it will look a lot more like C than Axe since the computer is fast enough and has enough memory to that I can automatically optimize the code so that you don't have to do all those weird syntax tricks like calling things with missing arguments or storing things after each other.
Title: Re: [idea] multi-page apps
Post by: DJ Omnimaga on December 17, 2010, 12:04:04 am
Would we still be able to use the original Axe syntax, though? It would be nice to have a computer version of Axe where we can still use Axe syntax if we do not understand C (like me, unless it's a higher level version of C?)
Title: Re: [idea] multi-page apps
Post by: jnesselr on December 17, 2010, 09:40:57 pm
If there are any assembly programmers who want to help me with it, I can post the app writing code if you're up for it, but I can hardly understand it myself since about a third of it is written by TI.
Can I get that code?
Title: Re: [idea] multi-page apps
Post by: Quigibo on December 19, 2010, 05:02:16 am
This is all of it I think.  It won't compile because its missing some variable declarations, and it isn't used in context, but if anyone can write pseudo-code or something that would be enough.  This is pretty complicated stuff.
Title: Re: [idea] multi-page apps
Post by: jnesselr on December 19, 2010, 06:44:57 pm
Oh, thank you very much! What does P2ldir do?
Title: Re: [idea] multi-page apps
Post by: Quigibo on December 20, 2010, 02:14:56 am
Its identical to ldir, but from page 2 of the app.
Title: Re: [idea] multi-page apps
Post by: jnesselr on December 20, 2010, 07:47:51 am
Okay, then what is RAM defined as?