• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 551951 times)

0 Members and 4 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #1470 on: November 04, 2010, 11:01:04 pm »
I wouldn't assume so. If I remember correctly, that area is destroyed by Garbage Collecting, so it might be touched by other OS routines too.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #1471 on: November 04, 2010, 11:16:49 pm »
Ok, no important stuff needed while using BASIC or other TI-OS commands is stored there that could crash the calc if deleted?

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 #1472 on: November 04, 2010, 11:24:48 pm »
Plus the various holes in RAM that the OS has, if you feel like going into Assembly.

You don't need to use assembly, as Axe is already capable of accessing any addressable RAM area. A good suggestion would be E8000, which has 256 bytes of space you can uses as temporary RAM.

I probably should have remembered that, given how much one of my projects directly addresses RAM :P
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1473 on: November 07, 2010, 06:06:45 pm »
random question: how many bytes is a name string? is the appv token 1 byte? are lower case letters 2 bytes still?

so for example: how large is this name string: "appvAbcDE"

and also: can you open a file 'over' another file

ie if you had appvar 1 open in Y1, can you call GetCalc(Str2,Y1) and have the appvar pointed to in Str2 now open as Y1?

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Axe Parser
« Reply #1474 on: November 07, 2010, 08:58:13 pm »
random question: how many bytes is a name string? is the appv token 1 byte? are lower case letters 2 bytes still?

so for example: how large is this name string: "appvAbcDE"

and also: can you open a file 'over' another file

ie if you had appvar 1 open in Y1, can you call GetCalc(Str2,Y1) and have the appvar pointed to in Str2 now open as Y1?
As for your last question, yes, it should work that way. I did that in one of my programs at some point, I just forget which one.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

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 #1475 on: November 07, 2010, 09:06:07 pm »
random question: how many bytes is a name string? is the appv token 1 byte? are lower case letters 2 bytes still?

Name string is however many bytes you make it, just like any other string. The appv char is two bytes: one for the var type (appvar), one for the actual token. And all lowercase letters are one byte unless you convert them individually with T.

so for example: how large is this name string: "appvAbcDE"

So that would be 7 bytes, plus a zero byte to signify the end of a string if you did something like "appvAbcDE"->Str1 for a total of eight bytes.

and also: can you open a file 'over' another file

ie if you had appvar 1 open in Y1, can you call GetCalc(Str2,Y1) and have the appvar pointed to in Str2 now open as Y1?

Yep, FinaleTI answered that one.
« Last Edit: November 07, 2010, 09:06:22 pm by Deep Thought »




Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #1476 on: November 07, 2010, 09:16:54 pm »
random question: how many bytes is a name string? is the appv token 1 byte? are lower case letters 2 bytes still?

Name string is however many bytes you make it, just like any other string. The appv char is two bytes: one for the var type (appvar), one for the actual token. And all lowercase letters are one byte unless you convert them individually with T.
Actually, appvars and programs don't have a token before the name. So appv is actually one byte.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #1477 on: November 07, 2010, 09:58:38 pm »
random question: how many bytes is a name string? is the appv token 1 byte? are lower case letters 2 bytes still?

Name string is however many bytes you make it, just like any other string. The appv char is two bytes: one for the var type (appvar), one for the actual token. And all lowercase letters are one byte unless you convert them individually with T.
Actually, appvars and programs don't have a token before the name. So appv is actually one byte.

Whoops, sorry x.x




Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1478 on: November 13, 2010, 12:31:45 pm »
K so I just found this post, and I was wondering if it is worth it to use the inData method for only 2 or 3 numbers (ie If inData(A,Data(1,2,0)) )
Code: [Select]
.Inefficient
If (A=3 or (A=5) or (A=20) or (A=28) or (A=61))
.Some code
End

.Efficient
If A
  If inData(A,Data(3,5,20,28,61,0))
  .Some code
  End
End
This is probably unnoticeable slower, but its much smaller and the routine is a subroutine so using it more than once in your program will definitely be a large size optimization.
« Last Edit: November 13, 2010, 12:32:24 pm by squidgetx »

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1479 on: November 13, 2010, 05:12:58 pm »
The inData() routine is actually a very efficient way to compare a variable with a list of constant byte values. the routine itself is 15 bytes, and each call is 11 bytes plus the size of the data (1 byte per value to check, and 1 byte for a null termination). Even if you're only checking to see if a variable equals either of 2 values, the size of the routine and the call (a total of 29 bytes with 2 values to check) is actually smaller than a compound or statement, like A=3 or (A=5) (31 bytes). If you had already used the inData() routine for something like this and the subroutine already exists in your code, comparing only 1 value with inData() (13 bytes) is actually the same size as a single equality check, like A=3. However, if you're only checking one equality, a better way than either of those is using !If A-3.

Bottom line:
  • 1 equality check: !If VAR-CONST
  • 2+ equality checks: If inData(VAR,Data(CONST,CONST,...,0))
« Last Edit: November 14, 2010, 12:13:01 am by Runer112 »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1480 on: November 13, 2010, 05:23:02 pm »
Quote
actually smaller than a single equality check
:o

Thanks Runer :)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #1481 on: November 13, 2010, 10:26:36 pm »
And don't forget that you have to end your list of data with 0 so the routine knows when the end of the list is reached.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #1482 on: November 13, 2010, 11:08:18 pm »
Bottom line:
  • 1 equality check: !If VAR-CONST
  • 2+ equality checks: If inData(VAR,Data(CONST,CONST,...))

Thanks! Didn't know that.




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1483 on: November 14, 2010, 12:11:46 am »
And don't forget that you have to end your list of data with 0 so the routine knows when the end of the list is reached.

Wow, completely forgot about that. Fixing that now.

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 #1484 on: November 14, 2010, 12:39:34 am »
Reading that 0 being the end of data thing, I assume if we ever need to use those routines in a game for an item menu, for example, that we must make sure that no item ID are equal to 0, right? For example, for an empty item slot it would be 1, potion 2, elixir 3, etc?