* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Run Axe program from an application ?  (Read 2922 times)

0 Members and 1 Guest are viewing this topic.

Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 323
  • Post Rating Ratio: +12/-0
    • View Profile
Run Axe program from an application ?
« on: February 19, 2015, 02:40:02 pm »
Basically what the title says.

I tried something stupid like
Code: [Select]
#Axiom(MEMKIT)
GetCalc("appvNope",1)->V
New(V,e9D93-V,5000)
GetCalc("prgmPROGRAM",Y0)
Copy(Y0,e9D93,5000)
(e9D95)() .9D95 to skip the AsmPrgm
Delete(V,e9D93-V,5000)
DelVar "appvNope"
but there are some problems. It does run the program from the app, and the program runs fine, but when it exits, there are problems (basically, if after running the program, I just do a "Return", the calculator turns off and RAM Clears when turned on).

I am pretty sure matref knows the answer to my problem after doing AxeSh :P



Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3151
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #1 on: February 19, 2015, 02:44:06 pm »
Can't you just do something with some inline ASM magic?
(sorry, not helping. I'll try something out when im home, because i don't have memkit on my calc)
« Last Edit: February 19, 2015, 02:59:39 pm by Cumred_Snektron »
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline CKH4

  • Extravagant Sushi
  • Super User
  • Join Date: Jan 2015
  • Location:
  • Posts: 872
  • Post Rating Ratio: +3/-2
    • View Profile
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #2 on: February 19, 2015, 03:00:45 pm »
Is this attempting to create a shell with axe?
  • Calculators owned: TI-83+, TI-84+


Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3151
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #3 on: February 19, 2015, 03:02:15 pm »
Oh! Oh! Wont
Code: [Select]
V
be corrupted after running the program, causing some random location to be deleted?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 323
  • Post Rating Ratio: +12/-0
    • View Profile
Re: Run Axe program from an application ?
« Reply #4 on: February 19, 2015, 03:30:42 pm »
Can't you just do something with some inline ASM magic?
(sorry, not helping. I'll try something out when im home, because i don't have memkit on my calc)
Well inline ASM can always help, but only if someone gives the helping portion of ASM.

Is this attempting to create a shell with axe?
Nope.

Oh! Oh! Wont
Code: [Select]
V
be corrupted after running the program, causing some random location to be deleted?
Nope, I checked and it keeps the same value from the beginning to the end.

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17892
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #5 on: February 19, 2015, 05:07:11 pm »
This is most likely due to saferam or other memory conflicts. When you exit the program you need to ensure that the state of the calculator RAM (and in the case of ASM programs, ports) is identical to how it was before you launched the program in the first place. I could be wrong, though, since I don't do much Axe, but this seems like the common cause when we exit something and stuff messes up.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3151
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #6 on: February 19, 2015, 05:36:20 pm »
Maybe put in a small test after
Code: [Select]
DelVar "appvNope"to see if
Code: [Select]
Delete(V,e9D93-V,5000)
DelVar "appvNope"
is causing problems
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 323
  • Post Rating Ratio: +12/-0
    • View Profile
Re: Run Axe program from an application ?
« Reply #7 on: February 19, 2015, 06:43:50 pm »
What do you mean by "small test" ?
If I put a Text(0,,"Back to App") right after the call, it is displayed.
If I put a Text(0,,"Temp ram deleted") after the Delete, it is displayed.
If I put a Text(0,,"Appvar deleted") after the DelVar, it is displayed.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3151
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #8 on: February 19, 2015, 06:51:17 pm »
hmm. But i think i've got a solution, but i'll have to test it out :P
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline Duke "Tape" Eiyeron

  • Urist McEiyolobster
  • Super User
  • Join Date: Nov 2014
  • Location: (V)(-_(//));(V)
  • Posts: 1636
  • Post Rating Ratio: +11/-2
  • Fanciest Walrus of the oceans.
    • @@Eiyeron
    • Eiyeron
    • /u/Eiyeron
    • Eiyeron
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #9 on: February 19, 2015, 07:39:08 pm »
T'was a double post but I was there.
  • Calculators owned: A lot.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3151
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #10 on: February 19, 2015, 07:48:19 pm »
Ah thnx.

So... I remembered there was a BCALL which runs an ASM program,
and i put it in an Axiom for you! :D
All the code you posted can now be replaced by a SINGLE line (well, 2 if you count #Axiom(RUN)):
Code: [Select]
Run("prgmPROGRAM")
The "Run(" token can be found in the stat-calc menu (QuadReg).
Have fun  ;)

Oh and btw the actual ASM which gets parsed form the axiom is a stunning 2 lines
EDIT: 6 lines. i fixed the asm_prgm_size part  ;)
« Last Edit: February 19, 2015, 08:03:26 pm by Cumred_Snektron »
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline matrefeytontias

  • Full User
  • Join Date: Nov 2014
  • Location: France
  • Posts: 198
  • Post Rating Ratio: +5/-1
  • Axe metalhead of vengence
    • @matrefeytontias
    • matrefeytontias
    • matrefeytontias
    • View Profile
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #11 on: February 19, 2015, 07:55:58 pm »
I am pretty sure matref knows the answer to my problem after doing AxeSh :P

* matrefeytontias comes to save the day

You have to use that certain BCALL called ExecutePrgm, but before that, you must save what is in asm_prgm_size ($89EC) somewhere, and you must restore it afterwards.

Cumred: you didn't take care of that asm_prgm_size part :P

EDIT : by the way, you probably wonder how to use it. So I did a nice opcode for you, just put a pointer to the name of the program in HL before calling it :
Code: [Select]
Asm(E72AEC89E5EF7C4EE122EC89)
« Last Edit: February 19, 2015, 07:59:14 pm by matrefeytontias »
  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 323
  • Post Rating Ratio: +12/-0
    • View Profile
Re: Run Axe program from an application ?
« Reply #12 on: February 19, 2015, 07:59:14 pm »
Thanks both of you :D

you must save what is in asm_prgm_size ($89EC) somewhere, and you must restore it afterwards.
How many bytes do I need to save ? 2 ?

Offline matrefeytontias

  • Full User
  • Join Date: Nov 2014
  • Location: France
  • Posts: 198
  • Post Rating Ratio: +5/-1
  • Axe metalhead of vengence
    • @matrefeytontias
    • matrefeytontias
    • matrefeytontias
    • View Profile
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #13 on: February 19, 2015, 08:00:03 pm »
Yeah two, but don't worry I edited the message with an opcode to execute directly.
  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3151
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Run Axe program from an application ?
« Reply #14 on: February 19, 2015, 08:05:25 pm »
You have to use that certain BCALL called ExecutePrgm, but before that, you must save what is in asm_prgm_size ($89EC) somewhere, and you must restore it afterwards.

Cumred: you didn't take care of that asm_prgm_size part :P
Ah thanks for clarifying. I fixed it ;)
* Cumred_Snektron sees a replacing hex code
* Cumred_Snektron cries a little inside :(
Also why do you need to save the asm_prgm_size part? im interested because it seemed to run fine without :P
 
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games