Author Topic: Data  (Read 7585 times)

0 Members and 2 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
Data
« on: October 13, 2010, 11:52:51 am »
I know that programs can't be more than 8811 bytes, or else they could crash when the TI-OS gets near the end, but that data can be stored there. But I heard that in Axe, data and subroutines are mixed, so does that mean that I shouldn't make programs more than 8811 bytes, even if they have a lot of data at the end?




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: Data
« Reply #1 on: October 13, 2010, 02:38:29 pm »
In Axe it only counts executable code. You can still have as much data as the rest of the RAM can hold (well, almost, so you can run the game lol)

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: Data
« Reply #2 on: October 13, 2010, 03:49:04 pm »
I think Quigibo mentioned somewhere that the subroutines used by commands could be mixed in with the data, though, so I'm not sure if it could work...




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: Data
« Reply #3 on: October 13, 2010, 03:50:12 pm »
Oh right I remember that. I think that won't make much difference in the end, though, when it comes to executable code size. However, maybe he could confirm in case...

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: Data
« Reply #4 on: October 13, 2010, 04:53:39 pm »
Hmm, I guess people could use Calcsys to check if there's code near the end...




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Data
« Reply #5 on: October 13, 2010, 05:20:38 pm »
Data is always at the end of the program, what he means by mixing code and data is that in your source, you can reference data inside your code, instead of declaring it somewhere else

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Data
« Reply #6 on: October 13, 2010, 05:32:59 pm »
I could have sworn that at some point Quigibo said he was mixing subroutines (for built-in commands and Axioms) with data...
This would mean that code and data are mixed and code will probably appear at the end of the program.
Quigibo will have to confirm this, of course.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

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: Data
« Reply #7 on: October 13, 2010, 07:53:35 pm »
Yeah, the code is compiled like this:

[ Header ]
[ Compiled Code ]
[ Data and AxCalls ]

The data is mixed with the Axe subroutines (which I am calling AxCalls now so you don't confuse them with user defined subroutines).  So these are not the subroutines that you call with sub() they are the routines used by Axe itself such as DispGraph, multiplication, static data, and interrupts for example.  They are in the order that you define them in the code so generally, when you define your data in the beginning of the code, the data is defined before your first call to the AxCalls.  So usually it looks like this:

[ Header ]
[ Compiled Code ]
[ Data ]
[ AxCalls ]

It is possible to have a 3rd pass to determine all the AxCalls you use in the program and add those first before adding the data but I'm really trying to avoid that becasue it would require a lot of code rewriting and would take 50% longer to compile.
___Axe_Parser___
Today the calculator, tomorrow the world!

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: Data
« Reply #8 on: October 13, 2010, 08:22:15 pm »
Ah, so if I put my data after my subroutines (after all the actual code), it should be safe?




Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Data
« Reply #9 on: October 13, 2010, 08:23:23 pm »
Does Axe support forward references yet? If so, yes.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Data
« Reply #10 on: October 13, 2010, 08:27:50 pm »
Nope :(

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: Data
« Reply #11 on: October 13, 2010, 10:52:19 pm »
Does Axe support forward references yet? If so, yes.

What are forward references? Are they references to data further down in the program?




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: Data
« Reply #12 on: October 14, 2010, 12:02:33 am »
Yeah, the code is compiled like this:

[ Header ]
[ Compiled Code ]
[ Data and AxCalls ]

The data is mixed with the Axe subroutines (which I am calling AxCalls now so you don't confuse them with user defined subroutines).  So these are not the subroutines that you call with sub() they are the routines used by Axe itself such as DispGraph, multiplication, static data, and interrupts for example.  They are in the order that you define them in the code so generally, when you define your data in the beginning of the code, the data is defined before your first call to the AxCalls.  So usually it looks like this:

[ Header ]
[ Compiled Code ]
[ Data ]
[ AxCalls ]

It is possible to have a 3rd pass to determine all the AxCalls you use in the program and add those first before adding the data but I'm really trying to avoid that becasue it would require a lot of code rewriting and would take 50% longer to compile.
What are AxCalls? Axioms?

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: Data
« Reply #13 on: October 14, 2010, 12:04:55 am »
They're the subroutines used in ASM. For example, multiplication by some arbitrary number takes a lot more than a couple simple commands, so to save space, a subroutine to multiply two numbers is added at the end, and whenever the program multiplies numbers, it calls the subroutine. Apparently, it's these subs that can be mixed with data, so that's a problem x.x




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: Data
« Reply #14 on: October 14, 2010, 02:28:36 am »
You mean stuff ran with Asm()?