Author Topic: Running Basic in Axe from an application  (Read 5798 times)

0 Members and 1 Guest are viewing this topic.

Offline Aspiring

  • LV3 Member (Next: 100)
  • ***
  • Posts: 81
  • Rating: +5/-0
  • The only source of knowledge is experience-Einsten
    • View Profile
Running Basic in Axe from an application
« on: April 03, 2014, 04:41:10 pm »
Hello everyone! I found on the forums a very nice routine by Xeda112358 for running basic programs in axe but it doesn't seem to work for applications.  Could anyone tweek it so that it can?  I would really appreciate it!   ;)   Thanks!   :D



Okay, so earlier I was asked by aeTIos for a hex code to run BASIC programs in Axe and I have heard that this was requested by others, so here goes my rendition... I am sorry in advance if my Axeing is horrible, this is only my second routine:
Code: [Select]
"prgmHELLO"→Str1                     ;Name of the var
Str1                                 ;To get the pointer to the string in HL (Ans)
Asm(E7FDCB08CEEF9B4AFDCB088E         ;


Here is the asm:

Code: [Select]
rst 20h
set 1,(iy+8)
B_CALL (_ParseInp)
res 1,(iy+8)

Offline Aspiring

  • LV3 Member (Next: 100)
  • ***
  • Posts: 81
  • Rating: +5/-0
  • The only source of knowledge is experience-Einsten
    • View Profile
Re: Running Basic in Axe from an application
« Reply #1 on: April 04, 2014, 11:00:34 am »
bump.

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: Running Basic in Axe from an application
« Reply #2 on: April 04, 2014, 03:13:02 pm »
I don't know why that code wouldn't work in an application, but if you really can't find a way to do it, then I guess you can copy that asm code to a temporary program, or to a ram page, and run it from there.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Running Basic in Axe from an application
« Reply #3 on: April 04, 2014, 08:49:38 pm »
Quote
I don't know why that code wouldn't work in an application, but if you really can't find a way to do it, then I guess you can copy that asm code to a temporary program, or to a ram page, and run it from there.
Haha, run a program to run a program?
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

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: Running Basic in Axe from an application
« Reply #4 on: April 04, 2014, 10:08:32 pm »
There are some parts of running an application that are a lot easier, and other parts that are more difficult.

The problem is, the way an App exits, it actually shuts down all contexts. This means that when it exits, it does not return to the program. The way a program is called to run, when it exits, it is just the OS exiting a subroutine. I actually think I wrote a routine to run an app, but it got a little complicated.

So there is a question: What is the app that you want to run? A lot of apps have a jump table that will allow you to call certain subroutines, or even the app itself without having to exit with the typical app exit procedure.

And a few notes: If you do run an app, you have to find a way to delete the copied Asm program from RAM. When an assembly program is run, it is actually copied to 9D95h (start of user RAM) and executed. When the program is done, the OS deletes the copy. If you run an app from within a program, the copy won't be deleted and you will have some eaten RAM. So the process that you will need to follow is for your program to locate the app, swap in its page, copy code to safe RAM that deletes the copy and jumps to the App.

For some information:
http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:4C51

Offline Aspiring

  • LV3 Member (Next: 100)
  • ***
  • Posts: 81
  • Rating: +5/-0
  • The only source of knowledge is experience-Einsten
    • View Profile
Re: Running Basic in Axe from an application
« Reply #5 on: April 04, 2014, 10:19:25 pm »
What you wrote about apps is very interesting (i wonder if the os could have been written better so that this problem doesn't happen) but I don't need to run apps just run compile an axe program into an app that can run ti basic programs.  :P   Using a routine in the post above (that you even made  ;) ) I get run basic programs when axe is compiled into the default shell but it crashed when I compile and run it as an app.   :(   Do you have any ideas about how to fix it?

Offline Aspiring

  • LV3 Member (Next: 100)
  • ***
  • Posts: 81
  • Rating: +5/-0
  • The only source of knowledge is experience-Einsten
    • View Profile
Re: Running Basic in Axe from an application
« Reply #6 on: April 07, 2014, 10:45:53 am »
Never mind found out that zstart offers this capability with this.

EDIT: fixed grammer issue

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Running Basic in Axe from an application
« Reply #7 on: April 07, 2014, 11:51:12 am »
That's right I forgot it did that :o good luck!
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.