Author Topic: [Axiom] Run (Un/Archived) External Assembly Programs  (Read 10801 times)

0 Members and 2 Guests are viewing this topic.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
[Axiom] Run (Un/Archived) External Assembly Programs
« on: March 06, 2012, 02:52:08 am »
I thought that some Axe programmers would find it useful to be able to run archived programs. Also, the Asm( sequence I posted to run programs in RAM will leak memory if the program you call throws an error. So I wrote an Axiom that lets you run other assembly/Axe programs and fixes memory leak issues. If you want, there's even a provision in there that lets you prevent your subprograms from being run from anything other than this Axiom, in case they do nothing useful on their own. Additionally, it also lets you catch errors that the OS may throw; that is, it lets you prevent that ERR: screen from showing up. The attached ZIP file contains the Axiom, its source code, and all the documentation. I'm a little afraid that the part of the documentation about error handlers is a little unclear, so if you're confused, feel free to ask questions.

Quigibo and Runer112: Feel free to optimize this---I'm sure it can be---and put it in Axe.


Here's an example. Let's say you have a fancy intro screen that's very large. You want it to run if the user has it---regardless of whether it's archived or in RAM---, but you want your program silently to skip running the intro screen if it doesn't exist. Just put this code in the main program:
Code: [Select]
:AppOnErr(LSKIP)
:RunPrgm("prgmINTRO")
:AppOffErr
:Lbl SKIP
:Your program continues here
« Last Edit: March 06, 2012, 03:33:16 pm by DrDnar »
"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 shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #1 on: March 06, 2012, 02:55:16 am »
they would indeed find it useful =D
thank you kindly

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #2 on: March 06, 2012, 05:46:07 pm »
Ah, this would make a great Axiom, and would help out a lot with a project like XDE (If it wasn't dead :P)
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #3 on: March 06, 2012, 07:13:47 pm »
Ah, this would make a great Axiom, and would help out a lot with a project like XDE (If it wasn't dead :P)
What do you mean, "would"? It is an Axiom.
"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 ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #4 on: October 19, 2013, 01:38:16 pm »
It works perfect for me and displays my own errors and everything, except when I exit the program, it displays the errors that the OS didn't show when the program ran. Is that normal? It's annoying.
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #5 on: May 15, 2016, 07:11:58 pm »
Again, there is no better place to put this.
It works perfect for me and displays my own errors and everything, except when I exit the program, it displays the errors that the OS didn't show when the program ran. Is that normal? It's annoying.
I'm having the same problem, am I not restoring something correctly?
I'm still around... kind of.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #6 on: May 17, 2016, 11:12:04 am »
That's . . . odd. Can you give me the simplest program that demonstrates the problem? Does running Asm(FDCB09A6 before quitting fix the problem?
"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 E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #7 on: May 17, 2016, 02:16:23 pm »
Here you go...
PROGRAM:RUN
.PRGM
Axiom(RUNPRGM)
[prgmBASIC]->A
[00]
"prgm*TEMP"->Str1
GetCalc(Str1,length(A))->B
Copy(A,B,{B-2}r
AppOnErr(lERR)
Str1:Asm(E7FDCB08CEEF9B4AFDCB088E)
AppOffErr
Lbl ERR
Asm(FDCB09A6)

PRGM:BASIC
595*,-5-*-5

when run it gives ERR:SYNTAX

Sorry for any weird words I had to fight spellchecker for each word :P
I'm still around... kind of.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #8 on: May 23, 2016, 11:31:34 am »
Asm(FDCB09A6) just attempts to reset the ERR:BREAK flag. Which isn't happening here.

The Axiom is intended for running external assembly programs. Does the issue with error messages only happen when you run BASIC programs? It's possible the error message isn't being cleaned up properly. From what I read in TI's SDK, you don't need to zero errNo after catching an error. But maybe I misread. Perhaps Asm(AF32DD86) will fix that.
"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 E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #9 on: May 26, 2016, 10:44:31 am »
Oddly enough, the error fixed itself.
I added some code to my main program. (I think it was a DelVar) and the errors stopped appering...
 ???
I'm still around... kind of.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #10 on: May 27, 2016, 09:02:11 pm »
Oddly enough, the error fixed itself.
That's usually not a good sign. It tends to mean you have (or had) latent bugs. Definitely check for memory leaks and signs of data corruption.
"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 E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: [Axiom] Run (Un/Archived) External Assembly Programs
« Reply #11 on: May 28, 2016, 12:24:28 pm »
I wouldn't be surprised.
I am using it in a program that uses a homescreen hook, and with a lot of hex codes that I don't really understand.
I don't have a way of converting hex to asm commands. (If I did it would probably easier to fix...)

Anyway I look at it RunPrgm is still vital to a good number of my projects!
Thanks for making it!  :thumbsup:
I'm still around... kind of.