• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 493416 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Axe Parser
« Reply #675 on: May 29, 2010, 11:21:57 pm »
Hi, and welcome to Omni.

First thing about the stuff on page 11 that you mentioned. Yes, if you put the constants on the end it will run faster. It is explained in the document or in the Auto Opts document provided. I don't think it really matter though just because it is just in a test program to show the functionality.

Another thing, that should really be in the Axe Pages thread probably.

I'm sure Quigibo will be along sometime soon to answer your questions and such.
« Last Edit: May 29, 2010, 11:22:40 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #676 on: May 30, 2010, 12:51:43 am »
Pointers (page 9)
Actually, there's no such thing as "the zeroth item"; the correct way to say this would be "the first byte has address zero, the second byte has address one". Not exactly intuitive, I know. If you don't want to change this I can understand.

Actually, in computer science, you really DO start counting at zero so you can have a 0th element as part of a list.  I even put a comic in there that mentions something about that.  Thanks for pointing out the other error though.

It might be easier to understand to write "GDB1+A" (assuming that Axe understands this; I didn't check, but assume it does). I understand the current notation is not so much wrong, but it could be unclear for beginning programmers.
Since you are very consistent about this notation, I assume there's a reason for it... performance? Can Axe optimize "A+GDB1" better than it optimizes "GDB1+A"? If so, maybe you should explicitely state both are valid, but "A+GDB1" is slightly faster.

"We use the curly brackets to indicate that we want the byte that's at the address of the pointer, not the the value of the pointer itself."
From reading your code samples:
Disp Str1        Displays the contents of the (probably zero-terminated) string starting at the address in Str1.
Disp {A+GDB1}    Displays the value of the single byte at base address GDB1 incremented with offset A.

That's quite a difference from what you're saying in the documentation...
To answer your first question, sometimes.  If you are adding an arbitrary number like A+492 or some pointer it won't generally make a difference.  But, certain numbers get automatically optimized (smaller size, faster speed) like A+1 or A-256, there is a big list of these "auto-ops" in the zip file.  My intention is to get the programmer in this habit so they don't have to think about it when optimizing their code.  Maybe I'll mention the reason somewhere there, I do mention it at the end in the optimization section.

About your other point, the first one takes a pointer as an argument, which is why it doesn't need the brackets.  The second one is supposed to have a ▶Dec that I forgot to add, fixed than now thanks.  That takes a number as an argument which is why you need the brackets.

Data & Arrays (page 11)

The comments for one of the pieces of sample code say "BAISC", oops...

An Example Program (page 14)

You're already using the "optimized dual-store":
0->S-1->D
This hasn't been explained yet and is hardly standard notation. Putting a note "see page 17 for details" would be helpful.

Optimization tricks (page 17)

"Evaluate all constant expressions before compiling."
It would be very awesome if you could teach Axe to recognize expressions working on two constants and automatically decide to pre-compute them...

I'm not sure what you're talking about with the "BASIC" thing... EDIT: Nevermind, just noticed the spelling :-[

Thanks for the other tips though.  I'll try to add some more stuff.  And the precompile constants I've actually been working on all this week, it will be in the next release.

"If the last line of your program is Return, then remove it. Even if it was part of a subroutine, the return is automatically added at the end for you so there's no need to have 2 returns at the end. Saves 1 byte."
Uhm, that saves 1 byte in the source, not in the executable, right?

Nope, executable :)  Although eventually I'll remove it automatically when compiling so the programmer doesn't have to bother with it.

And about commands.htm:
Fix CODE: Changes how text is drawn. Code must be a constant.
Wouldn't it make more sense to make CODE consist of flags? That way you can set multiple values at once. Especially useful if you want to reset everything at the end of your code.

ReturnIf EXP
Is there a special reason to include this? It seems to be equivalent to If EXP Return End.

That's actually a really cool suggestion!  Are you suggesting that saying Fix 135 would behave the same as Fix 1:Fix 3:Fix 5 ?  That could work, I like the idea!

The special reason is that its convenient for the programmer and its more optimized in the executable than doing an if statement.
« Last Edit: May 30, 2010, 01:34:06 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #677 on: May 30, 2010, 01:08:51 am »
Hi and welcome to Omnimaga!

To respond to Quigibo, I think what he means with "Also, when you're using free ram, it DOES NOT use any program ram like in BAISC." is that you spelt "BASIC" wrong. :P

To respond to our rvw, I like the Fix idea especially. For optimizations, I think Quigibo is planning this for upcoming versions. There might not be a lot of new commands added for a while but lot of parser-related stuff added.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline rvw

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: Axe Parser
« Reply #678 on: May 30, 2010, 12:14:20 pm »
And about commands.htm:
Fix CODE: Changes how text is drawn. Code must be a constant.
Wouldn't it make more sense to make CODE consist of flags? That way you can set multiple values at once. Especially useful if you want to reset everything at the end of your code.
That's actually a really cool suggestion!  Are you suggesting that saying Fix 135 would behave the same as Fix 1:Fix 3:Fix 5 ?  That could work, I like the idea!
Actually, I was thinking about binary flags. There's two possible ways to do this though...
Option 1: BigText = 1, so passing in any odd number (number with lsb set) will enable BigText while any even number (lsb reset) will automatically enable SmallText.
Option 2: make seperate, independent flags for "opposite options". So BigText = 1, SmallText = 2 (next option = 4, etc.).
Benefits option 1: room for more flags (I have no idea whether this is an issue), possibly more intuitive, probably easier to execute (the internal function which gets called when a programmer uses "Fix" would be smaller and faster).
Benefits option 2: it's possible to set one option without changing (and without knowing the current value of) other options (I don't know whether there are any situations where you'd want to do this).
Which option to choose (1, 2 or the approach you suggested yourself) is something you have to decide, I just wanted to point out the possibilities.

Btw, I understand Axe was developed specifically to be editable on-calc. However, I wonder whether you've thought about making a computer version as well? The data structure (source program) both versions see would be identical, so the port should be pretty straight-forward. (Well, except for the .8xp header, but that's not a big issue; the encoding of the content itself is the same, which makes life far easier.) I'm thinking about developing on-calc, then when you've completed your program (when you have to transfer it to a computer anyway if you intend to share it with more people then just a couple of friends), you pull it through a compiler which really tries hard to optimize things as far as possible, potentially using techniques which are just not suitable for the on-calc compiler.

Pointers (page 9)
Actually, there's no such thing as "the zeroth item"; the correct way to say this would be "the first byte has address zero, the second byte has address one". Not exactly intuitive, I know. If you don't want to change this I can understand.
Actually, in computer science, you really DO start counting at zero so you can have a 0th element as part of a list.
Like I said, it's a minor nit-pick; it's more of a linguistics thing than a technical one. I'm a computer science student myself, the standard example I know is "you have five fingers, with indices 0, 1, 2, 3 and 4. The first has index zero, the second has index one, ..., the fifth (and last) has index four." Essentially, ordinal numbers start at "first" (both in computer science and in general) while cardinal numbers start at zero (at least in computer science). With "ordinal numbers" and "cardinal numbers" I mean the linguistic terms.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #679 on: May 30, 2010, 02:09:50 pm »
As said in a recent post in one of the recent threads, I don't think Quigibo is planning a computer compiler until the on-calc version is finished. Otherwise, it will slow down development a lot if he got two versions to update at once.

For now, the only way to program Axe on the computer is to use SourceCoder (http://sc.cemetech.net . Note that you need a forum account there to use it) or some other TI-BASIC editors such as TI-Graph Link, and compile your files using Axe APP on WabbitEmu. Also I think Quigibo will be able to add some optimization routines that will not slow down compiling too much on calc. So far it already optimizes some stuff, yet it compiles my 1 KB programs in one second on a 6 MHz 83+
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Axe Parser
« Reply #680 on: May 30, 2010, 03:59:49 pm »
I wonder... if BASIC Builder could be used to package an Axe program into an app?? That could be an interesting work-around.

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Axe Parser
« Reply #681 on: May 30, 2010, 04:06:21 pm »
I wonder... if BASIC Builder could be used to package an Axe program into an app?? That could be an interesting work-around.
That would be interesting. Someone needs to check.
But I don't remember well if assembly programs were included in BASIC Builder.

Still that is not the same thing as running a true ASM apps.
« Last Edit: May 30, 2010, 04:06:46 pm by Galandros »
Hobbing in calculator projects.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Axe Parser
« Reply #682 on: May 30, 2010, 04:15:13 pm »
Checked.
Tried with both the source and the executable.

BASICBuilder compiles fine.
Running the APP throws back a syntax error.

EDIT: Lies and slander! Hold on to your horses!
EDIT 2: Nope. Still doesn't work. Tried to use a BASIC program to link up the two.
« Last Edit: May 30, 2010, 05:43:48 pm by Raylin »
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Axe Parser
« Reply #683 on: May 30, 2010, 05:42:23 pm »
Thank you Thank you Thank you Thank you THANK YOU for including the ability to copy multiple bytes (like LDIR)!!

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Axe Parser
« Reply #684 on: May 30, 2010, 05:48:59 pm »
I r confus.
Explain your spasm, sir.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Axe Parser
« Reply #685 on: May 30, 2010, 05:53:43 pm »
I r confus.
Explain your spasm, sir.

You understand addresses, I'm assuming.  With axe, you can copy a whole bunch of bytes from one address to another.  For instance, axes allows you to have a picture stored inside of an application variable, and then copy the picture to the buffer from the application variable.  In the same way, you can save a picture to an application variable.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Axe Parser
« Reply #686 on: May 30, 2010, 06:08:00 pm »
Awesome! :D
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #687 on: May 30, 2010, 06:11:47 pm »
Not only can you copy, but you can also fill large portions, and exchange large portions :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #688 on: May 30, 2010, 11:53:25 pm »
You mean the Conj() command? Because that command is epic. Fill() too. I used it a lot before.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #689 on: May 30, 2010, 11:56:15 pm »
Yeah both of them are soo useful :)  Especially when you use Fill() like this

Fill(5->{L1},700

It can fill a memory location in a single line ^^