Author Topic: Routines  (Read 314248 times)

0 Members and 1 Guest are viewing this topic.

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: Routines
« Reply #120 on: March 19, 2010, 07:47:33 pm »
Can I see the assembly for that write-back hex code?  And does it work when the program is archived?  And if so does it re-archive the program when it copies back?
___Axe_Parser___
Today the calculator, tomorrow the world!

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: Routines
« Reply #121 on: March 19, 2010, 07:51:43 pm »
Yeah, but from what it looks like there is no point where the data to be kept in the program is specified, so it seems to keep *all* the data D:
yeah I asked him more info about that but he never awnsered my question. I guess it was poorly worded :(

SirCmpwn

  • Guest
Re: Routines
« Reply #122 on: March 19, 2010, 08:03:53 pm »
mhmm I hope not x.x, cuz what if I have like 200 sprites in my data?

Hold your horses, Axe already puts the sprites there, and it doesn't take super long to copy.  Imagine Phoenix.  The time it takes Phoenix to exit is an outrageous example of an absurdly huge program writing back.  Descresion is not necissary.  Try it yourself - take your biggest Axe program and implement this.

Can I see the assembly for that write-back hex code?  And does it work when the program is archived?  And if so does it re-archive the program when it copies back?

The code is back a ways in terms of posts.  I'm going to modify it a little later on so that it works with archived programs.

yeah I asked him more info about that but he never awnsered my question. I guess it was poorly worded :(

Sorry, I have been offline.

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: Routines
« Reply #123 on: March 19, 2010, 08:39:27 pm »
Well, my main worry about huge writeback is that is there a memory limit in how much stuff can be written back? Let's say, for example, I create a RPG with 9 KB of map data.

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: Routines
« Reply #124 on: March 19, 2010, 08:56:22 pm »
That's pretty cool!  Great job SirCmpwn!  This opens a door in Axe programming. ;D
« Last Edit: March 19, 2010, 08:56:34 pm by ztrumpet »

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: Routines
« Reply #125 on: March 19, 2010, 09:08:14 pm »
I would like to eventually see this implemented in Axe, though, in one of the builds, even if not now. It would be much easier to use and less risk of accidentally doing a typo when typing the hex code, not to mention the source would probably be smaller.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Routines
« Reply #126 on: March 19, 2010, 10:05:16 pm »
Can I see the assembly for that write-back hex code?  And does it work when the program is archived?  And if so does it re-archive the program when it copies back?

The code is back a ways in terms of posts.  I'm going to modify it a little later on so that it works with archived programs.

Hold up, you can't even run no-stub ASM programs when they are archived, so this shouldn't be necessary.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Routines
« Reply #127 on: March 20, 2010, 02:33:19 pm »
Can I see the assembly for that write-back hex code?  And does it work when the program is archived?  And if so does it re-archive the program when it copies back?

The code is back a ways in terms of posts.  I'm going to modify it a little later on so that it works with archived programs.

Hold up, you can't even run no-stub ASM programs when they are archived, so this shouldn't be necessary.
You can run Archived no-stub Asm programs with DoorsCS and CalcUtil. :)

I also would like to see this implemented into Axe itself. :D

Offline Tribal

  • The Fallen
  • LV5 Advanced (Next: 300)
  • *
  • Posts: 218
  • Rating: +15/-1
    • View Profile
Re: Routines
« Reply #128 on: March 20, 2010, 03:04:56 pm »
Can I see the assembly for that write-back hex code?  And does it work when the program is archived?  And if so does it re-archive the program when it copies back?

The code is back a ways in terms of posts.  I'm going to modify it a little later on so that it works with archived programs.

Hold up, you can't even run no-stub ASM programs when they are archived, so this shouldn't be necessary.
You can run Archived no-stub Asm programs with DoorsCS and CalcUtil. :)

I also would like to see this implemented into Axe itself. :D

I think when DoorsCS encountered a archived program it just copied it to ram and ran it, I came across this situation a few times when DCS didn't delete the copy.

SirCmpwn

  • Guest
Re: Routines
« Reply #129 on: March 20, 2010, 04:09:36 pm »
Well, my main worry about huge writeback is that is there a memory limit in how much stuff can be written back? Let's say, for example, I create a RPG with 9 KB of map data.
You are thinking in a TI-Basic frame of mind.  Get out of it.  With pure assembly, there is direct access to the proccessor, and no interpreter in between.  A rough estimate to copy 9 KB is maybe about 6 seconds.  And, you can have a "saving..." screen, too.  I'll probably write some code later that will allow you to just store what you need into an AppVar or something.

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: Routines
« Reply #130 on: March 20, 2010, 09:18:53 pm »
I'm sorry SirCmpwn, but this:
You are thinking in a TI-Basic frame of mind.  Get out of it.
caused me to rate your post down.  You can write in Ti Basic and think about Axe like Ti Basic and still have amazing programs.  There is a Basic frame of mind, but  no reason that you need to "get out of it".

Remember, fighting does not solve any problems. :)

SirCmpwn

  • Guest
Re: Routines
« Reply #131 on: March 20, 2010, 09:28:42 pm »
I'm sorry SirCmpwn, but this:
You are thinking in a TI-Basic frame of mind.  Get out of it.
caused me to rate your post down.  You can write in Ti Basic and think about Axe like Ti Basic and still have amazing programs.  There is a Basic frame of mind, but  no reason that you need to "get out of it".

Remember, fighting does not solve any problems. :)

I would like to apologize for being offensive.  I did not mean any harm.  The reasoning behind my last post was because I felt that, in order to understand assembly code (which is the focus of the recent discussion), one had to have an assembly mentality.  In all honesty, copying 9KB from A to B is no sweat in assembly, where as in Basic it is an outrageous amount, and could be hard to grasp for a Basic programmer.  I know because I felt completely overwhelmed with assembly after using TI-Basic for so long, so I try to help out those who are used to using TI-Basic so that they don't feel the same way.  If I end up offending anyone in a post, I implore you to let me know like this so that I can fix it for the future.

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: Routines
« Reply #132 on: March 21, 2010, 12:10:41 am »
Well, my main worry about huge writeback is that is there a memory limit in how much stuff can be written back? Let's say, for example, I create a RPG with 9 KB of map data.
You are thinking in a TI-Basic frame of mind.  Get out of it.  With pure assembly, there is direct access to the proccessor, and no interpreter in between.  A rough estimate to copy 9 KB is maybe about 6 seconds.  And, you can have a "saving..." screen, too.  I'll probably write some code later that will allow you to just store what you need into an AppVar or something.
I was more worried about if there would be enough RAM areas left to put that 9 KB in for writeback purposes. For example, the pointers from L1 to L6 seemed to have limited RAM. This is why I asked. I was worried that if we tried to copy way too much data, that it could accidentally overwrite RAM areas that shouldn't be. I'm not sure if I understand the pointer concept in Axe, but what would happen if you loaded over 9000 bytes of hex data in L5?

Unfortunately, though, I rated down the post too, because one day you could be replying to a new member and scare him away, which is something we do not want. It also has risks of starting fights or feuds with certain people, especially if they are in a bad mood one day.

Also for my defense, it is not someone's fault if he doesn't understand something as easily as someone else. Understanding assembly is not for everyone. I myself tried for years and I barely even understand anything. This is something to understand, too.

Thanks for the apology, though.
« Last Edit: March 21, 2010, 12:11:58 am by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Routines
« Reply #133 on: March 21, 2010, 11:38:47 am »
Let me see if i understand the concept behind the global data concept.  When the program is run, it is copied to RAM somewhere safe where the TiOS can run it.  After it is finished executing, it is NOT copied back, making the program effectively write protected :/. So all we need to do is write a little bit of code to find out where the program acualy located (the first hex code) and store it in a safe place (L4) until the end of the program where we use it.  Once we get to the end, we merely copy the program right back to where it started again, so that any changes we made are permanent.  We are not using any of the L1-L6 variables for anything more than a 4 byte address storage during the program execution, so there is no possibility that we could run out of memory due to large programs.

(did i get that correctly?)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Routines
« Reply #134 on: March 21, 2010, 12:24:18 pm »
Let me see if i understand the concept behind the global data concept.  When the program is run, it is copied to RAM somewhere safe where the TiOS can run it.  After it is finished executing, it is NOT copied back, making the program effectively write protected :/. So all we need to do is write a little bit of code to find out where the program acualy located (the first hex code) and store it in a safe place (L4) until the end of the program where we use it.  Once we get to the end, we merely copy the program right back to where it started again, so that any changes we made are permanent.  We are not using any of the L1-L6 variables for anything more than a 4 byte address storage during the program execution, so there is no possibility that we could run out of memory due to large programs.

(did i get that correctly?)
Well actually, it is a 9-byte storage of the program name. But you've got the idea :)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman