Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: hardyboy16jm on December 05, 2012, 10:10:36 pm

Title: Archiving Programs within Axe programs
Post by: hardyboy16jm on December 05, 2012, 10:10:36 pm
Is there any way that I could archive an axe program within itself? When I say that, I mean the same axe program, too. Or if I can't do it within the main program, can I run a sub program and the archive the main program?
Title: Re: Archiving Programs within Axe programs
Post by: aeTIos on December 06, 2012, 06:58:58 am
That's not possible, since a program has to be copied into RAM in order to be run (Applications are another story but that's irrelevant here). Subprograms don't go like Basic in Axe, they are actually a part of the program. So sorry, no way to do it.
Title: Re: Archiving Programs within Axe programs
Post by: Eeems on December 06, 2012, 11:08:10 am
Well, you could try to do some sort of compression thing with your program and have it expand out things as they need it. You would run out of ram fast though, and I'm not sure you could get that much compression on your programs.
If someone made some sort of axiom for groups, so your launcher program would ungroup only the stuff you need at the moment from the group and then run it, that would be awesome though.

EDIT: Oh, wait, completely misread that. Actually you probably could figure out a way to do that, it would be tricky and require a lot of knowledge of the OS, and probably a lot of custom asm code.
Title: Re: Archiving Programs within Axe programs
Post by: Hayleia on December 06, 2012, 12:46:22 pm
But why do you want to archive the program you are runnin ? ???
Can't you just launch it with a shell that is able to launch archived programs (that is to say, any shell) ?
Title: Re: Archiving Programs within Axe programs
Post by: Xeda112358 on December 06, 2012, 04:03:37 pm
Yeah, I would suggest just running it from a shell, but that makes for a very interesting idea. Assembly programs are normally run from the OS by copying the original program to 9D95h. I think there should be no problem with archiving the original as the OS does not do any writebacks. Here is the hex code:
Code: [Select]
Asm(EFF14278B72003EFD84F
That must go at the beginning of your program! The reason is very simply that when the OS runs you program, it copies its name to OP1, that way when your program starts, it can reference the original program (for writeback and whatnot). However, there are a number of OS routines that will destroy OP1.

That should work, but I didn't test it.
Title: Re: Archiving Programs within Axe programs
Post by: Builderboy on December 06, 2012, 04:21:56 pm
If you compile your program for noshell, it's actually pretty easy and the OS doesn't get into your way:

Code: [Select]
.AXE
Archive "prgmAXE"

Ta da!
Title: Re: Archiving Programs within Axe programs
Post by: hardyboy16jm on December 06, 2012, 09:32:58 pm
But why do you want to archive the program you are runnin ? ???
Can't you just launch it with a shell that is able to launch archived programs (that is to say, any shell) ?
Oh, i probably should of put this in question, but I meant that while i was still making the game, i could archive itself while i was testing it because if tried to make it like five times but my calculator keeps getting frozen, so i have to take out the batteries and clear the ram
Title: Re: Archiving Programs within Axe programs
Post by: hardyboy16jm on December 06, 2012, 09:39:03 pm
If you compile your program for noshell, it's actually pretty easy and the OS doesn't get into your way:

Code: [Select]
.AXE
Archive "prgmAXE"

Ta da!
I tried this but got an error when i tried to compile. It said "no nested libs".
Title: Re: Archiving Programs within Axe programs
Post by: aeTIos on December 07, 2012, 03:47:50 am
In that case you have a subroutine in a subroutine.
Title: Re: Archiving Programs within Axe programs
Post by: willrandship on December 07, 2012, 04:04:43 am
Is that against the rules in Axe? I didn't know that.
Title: Re: Archiving Programs within Axe programs
Post by: aeTIos on December 07, 2012, 04:06:09 am
He might have an outdated version...
Title: Re: Archiving Programs within Axe programs
Post by: Builderboy on December 07, 2012, 04:10:46 am
If you compile your program for noshell, it's actually pretty easy and the OS doesn't get into your way:

Code: [Select]
.AXE
Archive "prgmAXE"

Ta da!
I tried this but got an error when i tried to compile. It said "no nested libs".
That seems like a strange error to get in those circumstances, what version of Axe are you running?  And are you sure you typed it in exactly right?
Title: Re: Archiving Programs within Axe programs
Post by: hardyboy16jm on December 07, 2012, 07:44:10 am
If you compile your program for noshell, it's actually pretty easy and the OS doesn't get into your way:

Code: [Select]
.AXE
Archive "prgmAXE"

Ta da!
I tried this but got an error when i tried to compile. It said "no nested libs".
That seems like a strange error to get in those circumstances, what version of Axe are you running?  And are you sure you typed it in exactly right?
I typed it exactly like that. I'm running v1.0.5
Oh, and by the way, I actually want to archive the source code for the program, not the compiled one.
Title: Re: Archiving Programs within Axe programs
Post by: stevon8ter on December 07, 2012, 07:58:32 am
Just do it manually? Cause you can compile archived programs... And download zstart, so you can even edit archived programs
Title: Re: Archiving Programs within Axe programs
Post by: shmibs on December 07, 2012, 10:12:47 am
If you compile your program for noshell, it's actually pretty easy and the OS doesn't get into your way:

Code: [Select]
.AXE
Archive "prgmAXE"

Ta da!
I tried this but got an error when i tried to compile. It said "no nested libs".
did you make sure to use tokens, rather than actually typing things out?
Archive should be the token accessible from the [2nd]+mem menu, prgm is a single token from the prgm menu, and the only thing actually using single characters is the program name.

In that case you have a subroutine in a subroutine.

that's not illegal in axe
Title: Re: Archiving Programs within Axe programs
Post by: squidgetx on December 07, 2012, 10:19:20 am
Nested libs means that you have an include in an include.

...you can compile archived source... And download zstart, so you can even edit archived source files
Also, this.
Title: Re: Archiving Programs within Axe programs
Post by: Builderboy on December 07, 2012, 03:08:01 pm
Additionally, Axe has an auto-backup feature that will backup your source when you compile it.
Title: Re: Archiving Programs within Axe programs
Post by: stevon8ter on December 07, 2012, 04:04:17 pm
Jup that's also true
Forgot to mention that :p
Title: Re: Archiving Programs within Axe programs
Post by: hardyboy16jm on December 07, 2012, 08:02:17 pm
Additionally, Axe has an auto-backup feature that will backup your source when you compile it.
and how does one get to the backed up code?
Title: Re: Archiving Programs within Axe programs
Post by: willrandship on December 07, 2012, 08:04:31 pm
When you compile it shows up in the bottom of the menu, with a # in front of the name.

It only backs up if it's not archived.