Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: E37 on March 09, 2016, 05:22:52 pm

Title: Running Basic Programs in Axe
Post by: E37 on March 09, 2016, 05:22:52 pm
So... I figured out how to, like the title suggests, RUN BASIC PROGRAMS FROM AXE!
Without more of an intro, here is the code.

.NAME
GetCalc("prgmBASIC",Y1 //gets the pointer to the basic program
[0523]->Str1           //stores the memory location of the home screen
GetCalc(Str1,{Y1-2}r) -> A
Copy(Y1,A,{Y1-2}r      //copy the program to the home screen
Asm(21F8893E02AE77)    //enables loops, if blocks, ect... on the home screen
Str1:Asm(E7EF9B4A)     //runs the program
Asm(21F8893E02AE77)    //returns to normal home screen

And that is all! Once this is compiled and run, it will execute prgmBASIC!
(Your previous entry will be the program that you just run...)
I imagine something bad will happen if the basic program throws and error, I probably should have included some kind of error handler (like the Runprgm Axiom)
I got the home screen swap hex code from here: http://tibasicdev.wikidot.com/hexcodes
Thanks Runner for the program execution hex code!

This works on my ti-84, is there any improvements I should make?
Title: Re: Running Basic Programs in Axe
Post by: Dudeman313 on March 09, 2016, 08:11:15 pm
That looks interesting! I wonder what happens if you try to run a non-existent program, tho....
I would tell you what you could improve on, but I still don't know Axe(but I'm starting in BASIC).
But nice!  :thumbsup:
Title: Re: Running Basic Programs in Axe
Post by: E37 on March 09, 2016, 08:42:34 pm
If you try to run a non existent program the screen just flashes for a second and then clears and displays done on the top right corner.
Nothing bad seems to happen. If the Basic program throws an error (Like if the user hit the ON key) the program quits the same way as usual. Overall it acts like you ran the program normally from the home screen. (with the exception of a nonexistent program)
(Learning Basic is the best place to start - that is where I began!)
Title: Re: Running Basic Programs in Axe
Post by: Dudeman313 on March 09, 2016, 09:39:52 pm
So, because you are running basic thru Axe, is it as fast as Axe, or as slow as basic? For example, would DJ Omnimaga's original Reuben Quest 2 run as fast as Sorunome's Axe app? Or would there be no change in running speed?
Title: Re: Running Basic Programs in Axe
Post by: Ivoah on March 09, 2016, 09:40:47 pm
So, because you are running basic thru Axe, is it as fast as Axe, or as slow as basic? For example, would DJ Omnimaga's original Reuben Quest 2 run as fast as Sorunome's Axe app? Or would there be no change in running speed?
There's no change in speed, since TI's BASIC interpreter is still actually running it. The Axe program just tells it what to run.
Title: Re: Running Basic Programs in Axe
Post by: Dudeman313 on March 09, 2016, 09:54:07 pm
Oh okay. But with this, you could have a TI-BASIC puzzle game inside an Axe RPG?
mumble mumble Reuben mumble Quest mumble mumble 3 mumble....
Title: Re: Running Basic Programs in Axe
Post by: Xeda112358 on March 10, 2016, 03:30:52 am
First, I want to say I am impressed at how you pieced that together (reminds me of my early days of hex coding).

This (https://www.omnimaga.org/axe-language/axe-how-to-execute-basic-programs/msg181010/#msg181010) may be more efficient and smaller.
Title: Re: Running Basic Programs in Axe
Post by: E37 on March 10, 2016, 03:44:32 pm
Thanks!
I mainly started it because Runner said that he didn't know of a way to run basic programs from Axe.
I'm not sure if he meant in pure Axe or with hex codes.
(now that I think about it, of course you can run basic programs with hex, it can be done in asm)

While I was posting I just realized that I am not sure on the correct pronunciation of Axe.
I just pronounce it like the tool ax, is that correct?
Title: Re: Running Basic Programs in Axe
Post by: Xeda112358 on March 10, 2016, 06:01:59 pm
It's pronounced like 'Ask'   :devil:

Spoiler For Spoiler:
Runer112 says I can't intentionally spread misinformation :( Yes, it is pronounced like "ax" :P
Title: Re: Running Basic Programs in Axe
Post by: TIfanx1999 on March 10, 2016, 06:23:06 pm
Axe and Ax are the same thing, thus they are pronounced the same. I'm more familiar with the spelling that uses the "e" on the end. I don't think I've seen the tool spelled ax before.
Title: Re: Running Basic Programs in Axe
Post by: E37 on March 13, 2016, 01:42:32 pm
I am working on a hybrid asm-basic program with this discovery and I am wondering, how do you disable the APD in basic while waiting for input?
Title: Re: Running Basic Programs in Axe
Post by: Xeda112358 on March 15, 2016, 04:54:31 pm
You cannot disable APD in BASIC, however, APD only happens with the functions Input, Pause, and Menu( (I may have missed something). In Axe, I think this should do the trick:
Code: [Select]
Asm(FDCB0896)
Title: Re: Running Basic Programs in Axe
Post by: E37 on March 20, 2016, 12:28:58 pm
Thanks!
I haven't tried the code but it has an odd number of characters.
Don't all hex codes need to have an even number?
Title: Re: Running Basic Programs in Axe
Post by: Xeda112358 on March 22, 2016, 06:59:44 pm
Oops, sorry. Somehow I forgot the '8' :S
(I edited the post with the code).