Author Topic: Axe Parser  (Read 551894 times)

0 Members and 7 Guests are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #1440 on: October 29, 2010, 07:58:30 pm »
Code: [Select]
Lbl 22
Return *22

Wow...didn't know you could do that. Thanks!

Yeah, you can start a line with a command like * or →. In Axe, it just operates it on the last value returned, kinda like Ans.




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1441 on: October 29, 2010, 08:41:01 pm »
Code: [Select]
Lbl 22
Return *22

Wow...didn't know you could do that. Thanks!

And also; what if I didn't need the r? Would it make a difference?

Yeah, in Axe commands don't need to be directly linked. Evaluating <exp> would put it's value into what you could call the "Ans of Axe" (the hl register), and you can act upon that value whenever you want. It doesn't have to be in a command on the same line, or in this case, even in the same general area of the program.

You can do some pretty crazy stuff using this. The most basic example would be something like this:
Code: [Select]
0→A→BYou're not actually saying 0→B, but because storing variables doesn't overwrite the "Ans of Axe," the value will remain and can be put in B. If you want to see a more advanced use of this, take this code for example, which I'm using in what I'm working on now:
Code: [Select]
Vsub(DM3)
...
Lbl DM3
  abs()-{r₁}
Return
The absolute value command doesn't even have an argument! But it doesn't care, it will operate on whatever is in "Ans." Entering an expression or value inside the parentheses would be a more logical way to put a value in "Ans" for the command to operate on, but if you don't enter anything there, "Ans" will simply stay as it was before the command was reached (in this case, with the value of V) and the absolute value of that will be calculated.


Also, adding the r to subroutine calls bloats the call a fairly large amount. Calling a subroutine always costs a base of 3, but without the r modifier, each argument takes 6 bytes, whereas calling a subroutine with the r modifier costs 15 bytes for each argument.
« Last Edit: October 29, 2010, 08:52:18 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #1442 on: October 29, 2010, 08:44:25 pm »
Unfortunately I do not understand the stuff explained in the long post on the other page very well, regarding that large RAM area, but basically, if someone was to use it, what would he need to do before exiting his Axe program to ensure that no problem occurs after exiting? Or is that RAM area updated by the TI-OS even during ASM code execution?

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1443 on: October 30, 2010, 10:54:08 am »
On a related but not related note, how large are the Rect(), RectI(), Rect()r, and RectI()r routines?

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Axe Parser
« Reply #1444 on: October 30, 2010, 11:53:16 am »
On a related but not related note, how large are the Rect(), RectI(), Rect()r, and RectI()r routines?

about as large as the sprite routines


Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1445 on: October 30, 2010, 11:58:40 am »
...How big are the sprite routines?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1446 on: October 30, 2010, 12:31:24 pm »
On a related but not related note, how large are the Rect(), RectI(), Rect()r, and RectI()r routines?

Rect():   114 bytes
RectI():   114 bytes

Rect()r and RectI()r are just modified calls to the Rect() and RectI() routines, respectively.

...How big are the sprite routines?

Pt-On:   126 bytes
Pt-Off:   134 bytes
Pt-Change:   126 bytes

Like with the rectangle routines, back buffer calls are just modified calls to these routines.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1447 on: October 30, 2010, 12:33:36 pm »
Ok; good. I'm going through all my code checking that my subroutines are actually worth having as subroutines using the 15byte-per-argument r. My window drawing routine saves about 393 bytes per call :)

I'm going to assume it's not worth it to make a routine that just does PtOn(r1,r2,r3) though...right?
« Last Edit: October 30, 2010, 12:35:26 pm by squidgetx »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axe Parser
« Reply #1448 on: October 30, 2010, 12:34:12 pm »
On a related but not related note, how large are the Rect(), RectI(), Rect()r, and RectI()r routines?

Rect():   114 bytes
RectI():   114 bytes

Rect()r and RectI()r are just modified calls to the Rect() and RectI() routines, respectively.

...How big are the sprite routines?

Pt-On:   126 bytes
Pt-Off:   134 bytes
Pt-Change:   126 bytes

Like with the rectangle routines, back buffer calls are just modified calls to these routines.

thanks that really changes how i code
« Last Edit: October 30, 2010, 12:34:45 pm by happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

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 #1449 on: October 30, 2010, 03:24:35 pm »
Those are the sizes of the subroutines, not the calling routines.  The first time you use Pt-On for instance, it creates the subroutine in the data section.  Then, it calls to that routine.  Each call after that no longer has to recreate that routine anymore and just links to the one that already exists.  The only time you would want to put an Axe call in a subroutine is if you're always using a specific combination of arguments over and over again in the code.

If you want to know the calling overhead, compile "Pt-On(1,2,3):Pt-On(4,5,6)" and subtract that size with "Pt-On(1,2,3)" and that's your calling overhead.
« Last Edit: October 30, 2010, 03:25:17 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Parser
« Reply #1450 on: November 04, 2010, 01:39:23 am »
I've been wondering about the Circle( command, ever since I tried to implement certain enemy movements in TWHG.
Can the radius be negative?
If not, will abs( work?
If neither, what detrimental effects might a negative-value radius cause?
Vy'o'us pleorsdti thl'e gjaemue

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 #1451 on: November 04, 2010, 01:47:02 am »
a circle with a negative radius makes weird graphical errors happen, and Abs() should fix it although why is your radius going negative in the first place?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #1452 on: November 04, 2010, 03:35:32 am »
Oh wait do you mean the weird fractal thing that occurs when it is negative? Quigibo posted a screenshot of it somewhere...

EDIT: On an off-topic note, awesome avatar Darl181. :D
« Last Edit: November 04, 2010, 03:36:49 am by DJ Omnimaga »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #1453 on: November 04, 2010, 12:02:25 pm »
Oh wait do you mean the weird fractal thing that occurs when it is negative? Quigibo posted a screenshot of it somewhere...

EDIT: On an off-topic note, awesome avatar Darl181. :D

I can't seem to find it. But it looked pretty awesome. I remember a discussion of whether or not to add an absolute value into the command itself...




Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Axe Parser
« Reply #1454 on: November 04, 2010, 01:23:38 pm »
That's actually really cool.

I made a quick program demonstrating it. The effect could be useful for games and such.

« Last Edit: November 04, 2010, 01:24:54 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ