Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: bored_student on October 31, 2012, 12:22:17 pm
-
I wanted to make my program code more clear.
So I decided to use static vars that replace some L1+... commands:
example:
L1+12 -> GDB0XVAL
L1+14 -> GDB0YVAL
...
X -> {GDB0XVAL}R
Y -> {GDB0YVAL}R
Is this slower than this:
X -> {L1+12}R
Y -> {L1+14}R
or is it the same after compiling
-
If it is a static var then I would assume that it would be the same speed. Static variables should be replaced by the actual value on compile if it's anything like static variables in other languages.
-
If you want to make it even clearer, you can do that:
L1+12→°XVAL
L1+14→°YVAL
...
X→XVAL
Y→YVAL
What you did there is declare two new custom variables, XVAL and YVAL, whose bytes are located at L1+12 and L1+14 ;)
edit
note that the ° is the degree symbol in Angle (2nd Apps).
-
thank you a lot ;D
I have never read that you can do something like that O.O
So I can easily make new vars.
How many characters can I use to name them and
from where do you know such things?
-
You might find reading the documents here useful: http://axe.eeems.ca/
-
How many characters can I use to name them and
from where do you know such things?
You can have up to 5 characters. I think the first one has to be an uppercase letter but maybe I am wrong.
And I know this kind of things by asking questions on this awesome website that is Omnimaga ;)
-
You might find reading the documents here useful: http://axe.eeems.ca/
This are the files included in the Axe download but I cant find something like
const -> °Var
however now I know it
thank you both you have helped me a lot :)
-
if you are storing the value to a variable then i am fairly certain it will be slower. i think the axe compiler simplifies L1+whatever to a single, in-line constant value, while accessing the other will first store the value to a different position in RAM during execution and then have to recall that value from the position in RAM when it is calling the value later.
-
The custom variable method was created to make creating custom variables relatively easily.
x->{L1+2}r is the same speed and size as L1+2->oVAR : x->VAR
Note that you can abuse the custom variable system to create named constants, similar to finals in java, only you can actually notice the speed difference. For example, 32->oMapW allows you to use oMapW in place of 32, anywhere in your code. Useful for debugging and clarity :)