Author Topic: Executing nostub progs  (Read 8999 times)

0 Members and 3 Guests are viewing this topic.

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Executing nostub progs
« on: November 17, 2010, 09:19:19 pm »
Is there a way to execute a nostub program from an Axe app, or would I need ASM code to use with Asm()? If so, what would that routine be?
« Last Edit: November 17, 2010, 09:19:36 pm by FinaleTI »


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Executing nostub progs
« Reply #1 on: November 17, 2010, 09:39:29 pm »
I believe it's actually quite simple to jump from an App to a nostub program and then back. Say the pointer to the program name you wanted to jump to was in P:
Code: [Select]
PAsm(E7EF7C4E)This would execute the program whose name is pointed to by P, just as if you had run it by typing Asm(prgmNAME) on the homescreen, and then return right back to where you were in the App when the program exits.

Can someone verify that this is safe to do? It appears to at least work for simple examples, but could any bcalls or other things during the time the program is executing overwrite data in the App?
« Last Edit: November 19, 2010, 10:15:07 am by Runer112 »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Executing nostub progs
« Reply #2 on: November 18, 2010, 07:13:28 am »
If it works, that could be very useful....

* squidgetx thinks he knows what FinaleTI is thinking
« Last Edit: November 18, 2010, 07:13:36 am by squidgetx »

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Executing nostub progs
« Reply #3 on: November 18, 2010, 08:56:22 pm »
It this is what you're thinking I'm thinking, then yes.

I did a small test that used a simple multi-page program I scrounged up, and executed it from an app. It worked flawlessly. :)


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Executing nostub progs
« Reply #4 on: November 18, 2010, 08:58:44 pm »
If it works, that could be very useful....

* squidgetx thinks he knows what FinaleTI is thinking
Getting around the 16 KB limit? I'm wondering...

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Executing nostub progs
« Reply #5 on: November 18, 2010, 09:00:28 pm »
That's the idea. ;D


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Executing nostub progs
« Reply #6 on: November 18, 2010, 09:02:37 pm »
Well, I see a few potential problems. For one, the program won't be called from a fixed location, so that means any calls will be wrong and could crash your calculator. Secondly, if the code executes beyond address BFFFh, I believe the calc automatically crashes.

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Executing nostub progs
« Reply #7 on: November 18, 2010, 09:12:01 pm »
Well, were does this copy to program too? If it copies it to 9D95h (I think that's right) then that would give me about 8810 bytes of code. Builderboy's multipage programs swap around a program's code to allow for multiple virtual pages to execute. Each virtual page essentially acts as a program and the code on the other pages isn't touched until you swap pages. So if the pages aren't larger than the code limit, I think that's OK.
But as for calls being wrong, what kind of calls? I've had Runer's code execute a simple multi-page program, as well as my current walking engine for Nostalgia without any noticeable adverse effects.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Executing nostub progs
« Reply #8 on: November 18, 2010, 09:15:08 pm »
Sorry, it looks like a few other posts occurred before I finished... :D Okay, it looks like there are some working ideas.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Executing nostub progs
« Reply #9 on: November 18, 2010, 09:31:19 pm »
The main problem I can see is that all of these Asm programs need to be in RAM, which might take up a lot of space. You could unarchive them before calling and archive afterwards, but that might cause garbage collects.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Executing nostub progs
« Reply #10 on: November 18, 2010, 10:37:45 pm »
I create them by copying data from archived appvars, so nothing needs to be rearchived, as Axe can read from the archive. Also, I would only have one program in the RAM at a time, so as to cut down on my memory footprint.
The temp program I create to house these programs gets deleted when the app quits.
I'll have to see about uploading a demo of what I'm doing when I'm not using my iPod.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Executing nostub progs
« Reply #11 on: November 19, 2010, 06:26:29 am »
Note that the address $9D95 is inside user RAM.  What does the hex code you posted do exactly?  If it copies it to $9D95 it needs to make sure it doesn't overwrite any user variables.  If it jumps straight to the address, absolute jumps and calls wont work anymore either.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Executing nostub progs
« Reply #12 on: November 19, 2010, 10:13:59 am »
The hex code I posted runs the assembly program whose name is pointed to by hl, just like if you were to run it from the homescreen with Asm(prgmNAME). It uses the bcall ExecutePrgm.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Executing nostub progs
« Reply #13 on: November 19, 2010, 02:10:58 pm »
^ so it simply stops execution in the current program and executes the pointed-to program, then returns to the original program?

I can't think of anything that might interfere...

Edit: something sort of related was discussed here
I'm not sure what ended up happening though :x
« Last Edit: November 19, 2010, 02:13:20 pm by squidgetx »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Executing nostub progs
« Reply #14 on: November 20, 2010, 03:48:05 am »
The hex code I posted runs the assembly program whose name is pointed to by hl, just like if you were to run it from the homescreen with Asm(prgmNAME). It uses the bcall ExecutePrgm.

oh okay gotcha :D