Author Topic: Features Wishlist  (Read 692179 times)

0 Members and 4 Guests are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2115 on: April 10, 2011, 01:43:39 pm »
I've always wondered: Wouldn't the method Runer described cause a memory leak in the stack because everything wasn't poped off the stack before placing the return address on the stack?

Nope, there'll be junk data where the stack used to extend, but it gets overwritten anyway, so it doesn't really matter.

What about Basic's Stop? How does that work?

The OS itself resets all its own variables to simulate ending a program (since BASIC is interpreted anyway, it's just like putting an end-of-program there).
« Last Edit: April 10, 2011, 01:44:51 pm by Deep Thought »




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Features Wishlist
« Reply #2116 on: April 10, 2011, 01:45:25 pm »
What about Basic's Stop? How does that work?
Well, I believe mostly the same way.  But considering that BASIC is parsed, I would think that the parser handles all of that for you.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Features Wishlist
« Reply #2117 on: April 10, 2011, 01:46:37 pm »
I've always wondered: Wouldn't the method Runer described cause a memory leak in the stack because everything wasn't poped off the stack before placing the return address on the stack?

Nope, there'll be junk data where the stack used to extend, but it gets overwritten anyway, so it doesn't really matter.
Ah, gotcha.  It makes sense now. :D  Thanks! ;D

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2118 on: April 10, 2011, 01:47:01 pm »
What about Basic's Stop? How does that work?
Well, I believe mostly the same way.  But considering that BASIC is parsed, I would think that the parser handles all of that for you.

Yeah, the OS just ends the program the same way it ends when the BASIC parser reaches the end of a program -- it resets pointers and flags back to how it was before the program was run.
« Last Edit: April 10, 2011, 01:47:35 pm by Deep Thought »




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #2119 on: April 10, 2011, 01:51:08 pm »
So, is there a B_Call for that?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2120 on: April 10, 2011, 01:57:54 pm »
Well, if there is, you won't be able to use it in an Axe program. ASM and BASIC are very different on the calc. Using the BASIC Stop in Axe would be like using Python's sys.exit() in C.




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #2121 on: April 10, 2011, 02:00:49 pm »
That...made no sense to me. I have no experience with PC programming.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2122 on: April 10, 2011, 02:35:04 pm »
Oh, sorry. Basically I just mean you can't use one language's routines in a different language, especially if they're run in fundamentally different ways (Axe is compiled, BASIC is interpreted).




Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Features Wishlist
« Reply #2123 on: April 10, 2011, 04:15:51 pm »
I've decided to try to incorporate Axe into zStart. But since Axe is constantly being changed, I can't statically link to addresses within it.

So my request is a call table that's at a static location that outside programs can call. The only two calls I can see needing though are:
-Compile OP1
-Set Axe Hooks

I want the Compile OP1 so I can make a button that compiles an Axe program. Preferably, have it display everything it normally does when compiling a program, and then just return. With enough hacking, this might even allow for an on-computer compiler.

And the set axe hooks would be so that even after ram clears, you have Axe's token set.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2124 on: April 10, 2011, 04:33:56 pm »
* Deep Thought seconds the request for compiling from OP1




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #2125 on: April 10, 2011, 04:51:20 pm »
Eight char var names, And the ability to (ab)use APD.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #2126 on: April 10, 2011, 05:00:54 pm »
I've decided to try to incorporate Axe into zStart. But since Axe is constantly being changed, I can't statically link to addresses within it.

So my request is a call table that's at a static location that outside programs can call. The only two calls I can see needing though are:
-Compile OP1
-Set Axe Hooks

I want the Compile OP1 so I can make a button that compiles an Axe program. Preferably, have it display everything it normally does when compiling a program, and then just return. With enough hacking, this might even allow for an on-computer compiler.

And the set axe hooks would be so that even after ram clears, you have Axe's token set.

Yes, I was definitely planning on adding hooks within Axe for external compiling.  Next update would be a good time to add them.

EDIT:  The only problem though is that Axe uses almost all of the free ram locations when compiling so you'd have to be extremely careful if you want your program to resume after the compile.
« Last Edit: April 10, 2011, 05:15:48 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Features Wishlist
« Reply #2127 on: April 10, 2011, 05:11:22 pm »
Thanks. And to prevent version conflicts, you might want to add a GetVersion call so that if you start adding a bunch of features, it won't crash if the version on someone's calc is too old.

Also, you should probably have some kind of flag to signify that Axe is at a high enough version to do this. Perhaps $1337 right before the call table?

Edit to your edit:
    I wouldn't be using any. It would be called from a hook, from an app.
« Last Edit: April 10, 2011, 05:15:41 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: Features Wishlist
« Reply #2128 on: April 10, 2011, 06:40:06 pm »
A way to Exit the program from within a subroutine, because both Return and goto end-of-program just end the subroutine.

There's no real command to do that in ASM either. In fact, you could think of the program itself as a big subroutine that calls smaller subroutines. There's are JForce bcalls in ASM, but they leave an extra copy of the program in RAM, causing a memory leak.
There are several work-arounds. You can, for example, use DeleteMem on 9D93h and then JForce your way out of the program. (The program's size is stored in 89ECh.) The easiest way to exit an assembly program at any time is to start the program with
Code: [Select]
pop hl
ld (returnAddress), hl
and then quit with
Code: [Select]
ld hl, (returnAddress)
jp (hl)
For this, stack level doesn't matter because the OS always wraps assembly code with an error handler; error handlers restore the stack when an error is thrown or you remove the handler. (Hopefully, all shells do something similar, too.) There's a specific memory address (86DEh) in which the OS stores the stack value of the most recent error handler, so you could also read that address, and then subtract the proper offset from it to get the address on the stack where the return address is stored. Of course, just throwing any error is a valid way to quit any assembly program.

EDIT: So, somebody already posted an Asm( string to quit at any time. I meant this more for Quigibo than end-users, as I think there should be an official way to quit at any time.
« Last Edit: April 10, 2011, 06:51:35 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

Ashbad

  • Guest
Re: Features Wishlist
« Reply #2129 on: April 10, 2011, 06:50:50 pm »
Well, with new stack commands, wouldn't it be possible to exit from a subroutine like this?

Code: [Select]
Lbl EXT
π -> A
Return

That should pop the address of the call to the routine, and then return like a normal program exit.  Correct me if I am mistaken.

Though this would not work in flash apps.