Author Topic: Library in an appvar?  (Read 9049 times)

0 Members and 1 Guest are viewing this topic.

Offline Ki1o

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +5/-2
  • Doing my best...
    • View Profile
Library in an appvar?
« on: October 07, 2012, 08:10:17 pm »
Ok bear with me for this one... Is it possible to make a command library and place it an appvar?

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Library in an appvar?
« Reply #1 on: October 07, 2012, 08:15:23 pm »
Maybe it's just me, but i feel like you need a bit more detail before I could actually answer, it seems a bit ambiguous... But to answer your question, probably, yes.
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline Ki1o

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +5/-2
  • Doing my best...
    • View Profile
Re: Library in an appvar?
« Reply #2 on: October 07, 2012, 08:20:21 pm »
Let me explain by example:

Say builderboy decides to makes an interactive app or something for zedd. Would it be possible to take the commands used in the original library and put them in an appvar so when the user opens the code editor (inside of the app) he/she can write out the commands and the program would still compile?

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: Library in an appvar?
« Reply #3 on: October 07, 2012, 09:11:43 pm »
There is no "code editor inside of the app." People writing Axe programs use the usual TI-BASIC editor (the one you get when you press PRGM and go to EDIT or NEW).

I don't know what you mean by "write out the commands," but here's a quick rundown of the types of variables Axe uses:

  • Source - program

    All Axe projects have a source program (the program with the code in it). These are what Axe looks for when it lists out the projects when compiling.

    You can edit source programs in the TI-BASIC editor.

  • Library - program

    Source programs can include code from libraries with the prgm token. It basically works like #include in C or import in other languages, if you know what either of those mean.

    You can edit libraries in the TI-BASIC editor. Libraries work like source programs except that they can't be compiled on their own—they need to be included into the source program.

  • Axiom - appvar

    Axioms are like extensions to the Axe language written in assembly. They're like libraries but in assembly instead of Axe language.

    You can't edit them with the TI-BASIC editor because they're assembly code (they're made for Axe, not with Axe).

  • Backup - appvar

    Backups are just archived appvar copies of Axe source programs. You can create, restore, and delete them from the Axe Parser app.

  • Executable - program

    The executable is what the user actually runs. It's the program produced by compiling a source program, and it's what people publish for others to download.

    You can't edit executables, and there's no way to get the original source or library programs used from them.

See Documentation.pdf in the Axe download for more info.

Zedd is a library—you can just get the 8XP files from the download and open the programs in the TI-BASIC editor.

Does that answer your question?
« Last Edit: October 07, 2012, 09:12:08 pm by Deep Thought »




Offline Ki1o

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +5/-2
  • Doing my best...
    • View Profile
Re: Library in an appvar?
« Reply #4 on: October 07, 2012, 09:47:09 pm »
Well... ummm I was thinking about the way xde had a "code editor" so people could use the app instead of the standard code editor.
EDIT : 40th post I lvled up!
« Last Edit: October 07, 2012, 09:58:33 pm by Ki1o »

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: Library in an appvar?
« Reply #5 on: October 07, 2012, 10:14:14 pm »
XDE didn't "have" a code editor—it was (supposed to be) a code editor and nothing else.

You can make editors just like anything else in Axe.




Offline Ki1o

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +5/-2
  • Doing my best...
    • View Profile
Re: Library in an appvar?
« Reply #6 on: October 07, 2012, 10:23:01 pm »
I'm sorry. One last question though. Back to the actual library part... could you put the commands in an appvar?

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Library in an appvar?
« Reply #7 on: October 07, 2012, 10:29:01 pm »
the commands ARE put in an appvar, but only for program backups, like he said. the programs that axe compiles are, and have to be, completely in the BASIC program format, with the exception of code inserted from axiom libraries.

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: Library in an appvar?
« Reply #8 on: October 07, 2012, 10:29:08 pm »
What would you do with an appvar?




Offline Ki1o

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +5/-2
  • Doing my best...
    • View Profile
Re: Library in an appvar?
« Reply #9 on: October 07, 2012, 10:42:36 pm »
Forgive me for putting you through all this trouble. I was was experimenting with an idea I had in my head and I just wanted to know if it was possible. Sorry.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: Library in an appvar?
« Reply #10 on: October 08, 2012, 01:32:19 am »
The Run Programs Axiom lets you call an external program (or a program typecast into an appvar) from an application. Axe variables aren't affected by the call. However, the transition in and out of the external code is pretty slow, an almost unavoidable* limitation of the OS.

*Yes, assembly programmers can come up with dozens of ways to get around that. None of them will integrate cleanly with Axe.
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1591
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Library in an appvar?
« Reply #11 on: October 08, 2012, 08:57:07 am »
*Yes, assembly programmers can come up with dozens of ways to get around that. None of them will integrate cleanly with Axe.

That honestly stopped me from writing like 5 different examples he could use. But I agree with DrDnar, you'll have to call external programs.



But the real reason I'm posting is to clarify his question. I'm fairly certain he wants to use an appVar like a .dll. Basically, he wants so be able to use runtime libraries to that he can simply call them at will from his program.

So, to answer that question, no, you can't easily do that, and here's why:
  • Where the appvars are stored, they are not executable
  • The appvar would have to be pulled out of flash and stuck in ram (this is similar to what simply running it does)
  • To be able to call the right routine in the appvar would absolutely require asm (and a lot of code counting)


While a runtime library axiom could in theory be created, you're best just to use libraries that go into the compiler (or just copy/paste the code). Also, you'll notice that in the past, all runtime libraries on the 84+ have been apps (xLib, Mirage, Doors, Celtic3) because apps can execute in place.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Library in an appvar?
« Reply #12 on: October 08, 2012, 11:59:07 am »
Forgive me for putting you through all this trouble. I was was experimenting with an idea I had in my head and I just wanted to know if it was possible. Sorry.
I don't see that it was trouble at all. It was a good question, and drew quite a few good responses. :)

Offline Ki1o

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +5/-2
  • Doing my best...
    • View Profile
Re: Library in an appvar?
« Reply #13 on: October 08, 2012, 01:00:47 pm »
thanks you all for your responses. and the penguin77, yes that was what I was thinking about but I couldn't think of a decent explanation atm. what if instead the dll was inside of the app instead of it being an external var, would that be possible? or would I need asm for that as well?

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1591
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Library in an appvar?
« Reply #14 on: October 08, 2012, 02:05:12 pm »
thanks you all for your responses. and the penguin77, yes that was what I was thinking about but I couldn't think of a decent explanation atm. what if instead the dll was inside of the app instead of it being an external var, would that be possible? or would I need asm for that as well?

You could totally put it inside an app, but it's not going to be as clean as you like. You app would look like this: (asm)
Code: [Select]
;this is a comment
;jp is jump

startOfApp: ;addresses
jp routineA ;4080h
jp routineB ;4083h
jp routineC ;4086h
jp routineD ;4089h
jp routineE ;408Ch

routineA:

;blah

routineB:

;blah

routineC:

;blah

When your axe program runs in ram, it runs in the $8000-$BFFF region (not exactly, but close enough). You can then swap the library app into the $4000-$7FFF region with a bit of asm. Then, to call your subroutines, you would simply call the addresses of their jumps. I'm not exactly sure what the mechanism is in Axe, but I know you can call absolute addresses.

The real trouble would be making that app. Maybe someone better than me with Axe knows how to put a jump table in like that, but I don't. So totally possible in theory, a bit of trouble in practice.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112