Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Compynerd255 on April 11, 2011, 04:22:46 pm

Title: Constants in an Axiom
Post by: Compynerd255 on April 11, 2011, 04:22:46 pm
I'm working on a simple CALCnet axiom (I'm not really an ASM programmer, but all CALCnet needs is four subroutines and a few memory pointers). Because CALCnet relies so much on pointers, how do you define a constant in Axe, like how L1-L6 function?
Can I just define the constant as a replacement routine,
Code: [Select]
$8800
or do I need to define all of the things you can do with the constant (load, add, subtract, multiply, divide...)?
Code: [Select]
ld hl, $8800
...
add hl, $8800
...
sub hl, $8800
...
Title: Re: Constants in an Axiom
Post by: Runer112 on April 11, 2011, 04:30:01 pm
You can define a token to be an immediate value load by making the full code ld hl,constant, but that's about as close as you're going to get to constants. When used in an expression it won't have any special constant optimizations, it will just be treated like a value in parentheses.
Title: Re: Constants in an Axiom
Post by: Compynerd255 on April 11, 2011, 05:38:16 pm
You can define a token to be an immediate value load by making the full code ld hl,constant, but that's about as close as you're going to get to constants. When used in an expression it won't have any special constant optimizations, it will just be treated like a value in parentheses.
Phew... I was afraid that I'd have to write in all of the constant expressions. However, all I would really need to write in is load and add, since that's all you're going to use a pointer for.
CALCnet Axiom, here I come.