• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 496242 times)

0 Members and 1 Guest are viewing this topic.

Offline BlackRabbit

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Re: Axe Parser
« Reply #1425 on: October 27, 2010, 10:12:30 pm »
I've recently completed Warrior 2, another big RPG, in Ti-Basic with xLib. The only problem is that I have an 83+ so I cannot send it to the computer and upload it. I've also done several other projects but not any that I am still prowd of.


this is a bit off topic to respond and I'm sorry, but you CAN transfer it if you buy a certaqin type of cable, or type it up in source coder.

okay. I'll do that.
Quote

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 #1426 on: October 27, 2010, 11:13:38 pm »
I've recently completed Warrior 2, another big RPG, in Ti-Basic with xLib. The only problem is that I have an 83+ so I cannot send it to the computer and upload it. I've also done several other projects but not any that I am still prowd of.


this is a bit off topic to respond and I'm sorry, but you CAN transfer it if you buy a certaqin type of cable, or type it up in source coder.

okay. I'll do that.

Alternatively, if someone else  owns a TI-84 Plus or a TI-Nspire with 84+ keypad and you got a link cable, and that person lets you borrow  his calc, just send your program to his calc, take a mini-USB to USB cable (a camera one will do) then use it to transfer it to the computer from the 84+ calculator. That's what I did with my 83 Plus since I did not have the appropriate cable for a while.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Axe Parser
« Reply #1427 on: October 27, 2010, 11:58:13 pm »
Have you made use of the whopping 1094 bytes of effectively safe RAM starting at $8000?
"Safe" I'd have to dispute... sure, all of RAM can be considered "safe" if you disable interrupts and never call any system routines.  And if you're going as far as keyExtend, you're already trashing the keypad-scanning variables, so why stop there?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1428 on: October 28, 2010, 05:53:52 am »
Have you made use of the whopping 1094 bytes of effectively safe RAM starting at $8000?
"Safe" I'd have to dispute... sure, all of RAM can be considered "safe" if you disable interrupts and never call any system routines.  And if you're going as far as keyExtend, you're already trashing the keypad-scanning variables, so why stop there?

For his purpose of parsing, during which key inputs aren't checked, it won't matter if he overwrites that. Although if he didn't want to overwrite it, I'm sure 1,093 bytes would be just as good. I've filled these 1,094 bytes of RAM with random data a few times before to see if it affects anything, and the calulator runs fine. I've actually been using the calculator to do other stuff since then, with this area of RAM having been filled with garbage, and no side affects have cropped up.

EDIT: Or, just to be safe, I remembered that Iambian mentioned something about this on IRC a while ago (here) when I was considering using this area as temporary storage:
Quote
[22:19:28] <Runer112> yeah, appdata is 8000h
[22:19:29] <Iambian> You're free to use that area regardless.
[22:19:44] <Runer112> appdata is completely safe for my purposes? whether or not i'm running an app?
[22:19:52] <Iambian> Thought you were talking about something that looks more important, like baseAppBrTab or something.
[22:20:21] <Iambian> Either way, this magic romcall that (I think) BrandonW found recovers most of it before you want to exit. bcall($5011) it is.
[22:20:52] <Iambian> It was noted in my source as "restores first 1087 bytes in RAM"
« Last Edit: October 28, 2010, 06:53:05 am by Runer112 »

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 #1429 on: October 28, 2010, 07:10:22 am »
Is that area used by any shell like Doors, Mirage or Ion?

On an semi-unrelated note, would Axe programs be compilable for CrunchyOS?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: Axe Parser
« Reply #1430 on: October 28, 2010, 09:16:24 am »
None of my axe progs show up in Crunchy

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 #1431 on: October 28, 2010, 06:16:10 pm »
Ah ok. I haven't used Crunchy in 6 years so I totally forgot how we made programs for it. X.x
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

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 #1432 on: October 28, 2010, 07:14:32 pm »
On an semi-unrelated note, would Axe programs be compilable for CrunchyOS?

Doesn't Crunchy support all Ion and MOS programs, though?




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 #1433 on: October 28, 2010, 09:48:37 pm »
Yeah I remember it did, but I don't remember if they needed to be re-compiled, compressed or something.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Axe Parser
« Reply #1434 on: October 28, 2010, 11:19:58 pm »
For his purpose of parsing, during which key inputs aren't checked, it won't matter if he overwrites that. Although if he didn't want to overwrite it, I'm sure 1,093 bytes would be just as good. I've filled these 1,094 bytes of RAM with random data a few times before to see if it affects anything, and the calulator runs fine. I've actually been using the calculator to do other stuff since then, with this area of RAM having been filled with garbage, and no side affects have cropped up.

EDIT: Or, just to be safe, I remembered that Iambian mentioned something about this on IRC a while ago (here) when I was considering using this area as temporary storage:
Quote
[22:19:28] <Runer112> yeah, appdata is 8000h
[22:19:29] <Iambian> You're free to use that area regardless.
[22:19:44] <Runer112> appdata is completely safe for my purposes? whether or not i'm running an app?
[22:19:52] <Iambian> Thought you were talking about something that looks more important, like baseAppBrTab or something.
[22:20:21] <Iambian> Either way, this magic romcall that (I think) BrandonW found recovers most of it before you want to exit. bcall($5011) it is.
[22:20:52] <Iambian> It was noted in my source as "restores first 1087 bytes in RAM"
If you don't have a solid understanding of what a RAM area is used for, when it's used, and what the consequences might be of modifying it, how can you say whether it's "safe" for your application?

(Experimenting and finding things that seem not to crash is really not a substitute for this level of understanding.  To wit: I can infer from your comment above that either you have an 84+, or you never use Flash apps.)

"Restores first 1087 bytes in RAM" is cute, but wrong, and frankly, kind of a dangerous thing to go around telling people.

The term "safe" is meaningless without context: what is safe depends both on what type of program you're writing - i.e., the context in which it will be executed - and on what your program is going to do.  By safe, we generally mean that
 (1) a RAM area is not going to be modified by any system or library calls we intend to perform, or by the system interrupt routine, and
 (2) the RAM are is not already in use at the time our program runs (so altering the data there will not have any effect on the system), or more specifically, it won't be expected to contain valid data at the time our program exits.

In some cases we may also want to consider areas where the RAM is already in use, but
 (a) it can be easily reset to its default settings,
 (b) we can reliably ensure the reset routine does get called, regardless of when or how our program terminates, and
 (c) the user won't mind us trashing his or her data.

In brief: the RAM areas between 8000h and 843Dh (I'm going to go ahead and assume you didn't mean to include kbdScanCode and friends) are used by a lot of different system routines under a lot of different circumstances.  As far as I know, all of this memory except for baseAppBrTab is scratch memory (it satisfies condition 2 for most execution environments), but whether it satisfies condition 1 is dependent on what system routines you're using, what hooks those routines might call, whether APD is possible, and whether silent linking is possible.

As for baseAppBrTab, it does not satisfy condition 2 at all, and it is absolutely essential that the table be correctly populated when your program exits.  Realize that the primary purpose of the table is for performing application B_CALLs - so really, it ought to be correctly populated at any time when a hook might be called, or in a shell program, at any time when a shell library might be called.  In practice, using that area is so dicey that I would not feel comfortable doing so at any time when any code outside my control might be executed.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1435 on: October 29, 2010, 03:48:07 pm »
random question: is it worth it to put this code in a subroutine?

<exp>*22+GDB0+<constant>..... so it looks like sub(0r,<exp>,<const>).....lbl 0 : r1*22+GDB0+r2

I would almost always need the r when calling this routine, and I suspect that the size of calling sub(lblr) with two arguments to be loaded might be bigger than just typing it out every time. Can anyone confirm? Also, I will be using this snippet of code only around 15 times throughout
« Last Edit: October 29, 2010, 03:51:50 pm by squidgetx »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Parser
« Reply #1436 on: October 29, 2010, 03:50:21 pm »
Has anyone tried running Axe Parser in TI NSpire w/ 84+ keypad?

I can't, when I open the application Axe what shows up immediately is the Compile list and I can't compile them due to Unknown Error (and they are written in Axe, for sure).

Any ideas?

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 #1437 on: October 29, 2010, 05:23:37 pm »
I did and I can get it to work fine. There might be something wrong with your TI-Nspire. Have you tried reinstalling the OS?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1438 on: October 29, 2010, 07:28:20 pm »
random question: is it worth it to put this code in a subroutine?

<exp>*22+GDB0+<constant>..... so it looks like sub(0r,<exp>,<const>).....lbl 0 : r1*22+GDB0+r2

I would almost always need the r when calling this routine, and I suspect that the size of calling sub(lblr) with two arguments to be loaded might be bigger than just typing it out every time. Can anyone confirm? Also, I will be using this snippet of code only around 15 times throughout

If you use a line with that format only once or twice, it would be optimal to just to type it all out in those instances. If you use it more than twice, the most optimized way would be as follows:
Code: [Select]
<exp>sub(22)+GDB0+<constant>
Lbl 22
Return *22



EDIT: So as not to double post, I'll add this as an edit. It is, however, completely unrelated.
For his purpose of parsing, during which key inputs aren't checked, it won't matter if he overwrites that. Although if he didn't want to overwrite it, I'm sure 1,093 bytes would be just as good. I've filled these 1,094 bytes of RAM with random data a few times before to see if it affects anything, and the calulator runs fine. I've actually been using the calculator to do other stuff since then, with this area of RAM having been filled with garbage, and no side affects have cropped up.

EDIT: Or, just to be safe, I remembered that Iambian mentioned something about this on IRC a while ago (here) when I was considering using this area as temporary storage:
Quote
[22:19:28] <Runer112> yeah, appdata is 8000h
[22:19:29] <Iambian> You're free to use that area regardless.
[22:19:44] <Runer112> appdata is completely safe for my purposes? whether or not i'm running an app?
[22:19:52] <Iambian> Thought you were talking about something that looks more important, like baseAppBrTab or something.
[22:20:21] <Iambian> Either way, this magic romcall that (I think) BrandonW found recovers most of it before you want to exit. bcall($5011) it is.
[22:20:52] <Iambian> It was noted in my source as "restores first 1087 bytes in RAM"
If you don't have a solid understanding of what a RAM area is used for, when it's used, and what the consequences might be of modifying it, how can you say whether it's "safe" for your application?

(Experimenting and finding things that seem not to crash is really not a substitute for this level of understanding.  To wit: I can infer from your comment above that either you have an 84+, or you never use Flash apps.)

"Restores first 1087 bytes in RAM" is cute, but wrong, and frankly, kind of a dangerous thing to go around telling people.

The term "safe" is meaningless without context: what is safe depends both on what type of program you're writing - i.e., the context in which it will be executed - and on what your program is going to do.  By safe, we generally mean that
 (1) a RAM area is not going to be modified by any system or library calls we intend to perform, or by the system interrupt routine, and
 (2) the RAM are is not already in use at the time our program runs (so altering the data there will not have any effect on the system), or more specifically, it won't be expected to contain valid data at the time our program exits.

In some cases we may also want to consider areas where the RAM is already in use, but
 (a) it can be easily reset to its default settings,
 (b) we can reliably ensure the reset routine does get called, regardless of when or how our program terminates, and
 (c) the user won't mind us trashing his or her data.

In brief: the RAM areas between 8000h and 843Dh (I'm going to go ahead and assume you didn't mean to include kbdScanCode and friends) are used by a lot of different system routines under a lot of different circumstances.  As far as I know, all of this memory except for baseAppBrTab is scratch memory (it satisfies condition 2 for most execution environments), but whether it satisfies condition 1 is dependent on what system routines you're using, what hooks those routines might call, whether APD is possible, and whether silent linking is possible.

As for baseAppBrTab, it does not satisfy condition 2 at all, and it is absolutely essential that the table be correctly populated when your program exits.  Realize that the primary purpose of the table is for performing application B_CALLs - so really, it ought to be correctly populated at any time when a hook might be called, or in a shell program, at any time when a shell library might be called.  In practice, using that area is so dicey that I would not feel comfortable doing so at any time when any code outside my control might be executed.

You were right, I did accidentally look over the fact that baseAppBrTab is present in this area of RAM. That's why I later searched for Iambian's reference to bcall($5011). I know it does not "Restores first 1087 bytes in RAM," and I'm sure Iambian does too. But it restores the data in baseAppBrTab. As long as this bcall was called after use of this RAM area and hooks/interrupts didn't try to use it while you were (which I believe should be relatively easy to ensure), it should be okay to use it.

I also did know that a lot of the other data areas in there were used by system routines, but for the purpose of parsing, during which I would assume very few bcalls are used (key input bcalls are included in those not used), it would be okay to fill these areas with your own data.

However, I did completely forget one very important thing: Axe is an application. So it probably shouldn't be using baseAppBrTab at all. Or ramCode for that matter, located at $8100. So you're right, now that I think about this again, this area of RAM isn't entirely safe to use. Although appData (256 bytes starting at $8000) and tempSwapArea (323 bytes starting at $82A5) are large blocks that should be safe to use.
« Last Edit: October 29, 2010, 08:30:13 pm by Runer112 »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1439 on: October 29, 2010, 07:50:24 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?
« Last Edit: October 29, 2010, 07:50:55 pm by squidgetx »