Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Quigibo on June 27, 2010, 03:01:01 am

Title: Axiom SDK For Developers
Post by: Quigibo on June 27, 2010, 03:01:01 am
This is for all assembly programmers who want to develop Axioms for Axe, you can post your questions, related bugs, and other concerns here.  Although I have not actually finished the Axiom feature, I have finished a template for the format I am most likely to use.  It is possible that there could be some very minor changes, but you will easily be able to compensate for those.  I just want to release this now so people can start writing their routines in preparation for this feature.

I included the SDK as well as an example Axiom that shows how some of the current functions could be written as Axioms.  Unfortunately, I realized that it will not be possible to redefine the token names as I was planning since the hook would take too long to search through the program to figure out which Axioms are used in that source and then search through those appvars every time a token is displayed in the editor.  The slowdowns would be too great especially for larger libraries.

Anyway, happy programming!
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 27, 2010, 03:04:22 am
This shall be interesting. People, though, just need to remember that those are against the programming contest rules, though, so do not use them in your entry.

Title: Re: Axiom SDK For Developers
Post by: Ikkerens on June 27, 2010, 04:10:37 am
This shall be interesting. People, though, just need to remember that those are against the programming contest rules, though, so do not use them in your entry.



What if Quigibo finishes this in a reasonable time?
And: Will it be able to be a data container?
For example all maps:
Code: [Select]
MyMap:
       .db $00,$45
       .db $01,$FF
Title: Re: Axiom SDK For Developers
Post by: Quigibo on June 27, 2010, 04:12:40 am
No, this can't be used in the contest because this is assembly code which is against the rules.  These are not the Axe libraries, these are the assembly libraries.
Title: Re: Axiom SDK For Developers
Post by: Ikkerens on June 27, 2010, 04:15:40 am
No, this can't be used in the contest because this is assembly code which is against the rules.  These are not the Axe libraries, these are the assembly libraries.

What about data containers? (Edited my previous post)
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 27, 2010, 04:31:47 am
Yeah the contest is meant to push the Axe language to its limits without any usage of ASM, BASIC, Doors (well, except launching the game from the APP of course), BBC Basic or anything that isn't Axe. Inline ASM is disallowed too. Else that defeats the purpose and goal of the contest if people starts cheating by using ASM in their programs
Title: Re: Axiom SDK For Developers
Post by: Quigibo on June 27, 2010, 04:45:55 am
In addition, your idea doesn't make any sense.  How could you use an inline command to store data?  The regular methods for Axe data storage involves moving data to the end of the program and gives you a pointer but the assembly is inserted directly at the place you put it.  Its like saying you would rather use Asm(Data) to store your data instead of [Data] since both store hex values into the program.  The difference is that the first one executes the data and the later is just storage.  Although technically its possible to store data in Axioms, its much less efficient and requires difficult assembly to make it usable as data.  Such assembly would be against the rules anyway.
Title: Re: Axiom SDK For Developers
Post by: nemo on June 27, 2010, 11:37:12 am
i'm not sure if this would be the right place to ask, but could someone make an axiom to store string data into a BASIC string var?
Title: Re: Axiom SDK For Developers
Post by: Galandros on June 27, 2010, 02:01:49 pm
Excellent idea Quigibo. This will make possible endless addons to Axe Parser.

I read the Axiom should be an appvar. You just compile as a program and convert it to program on calc. CelticIII can be a solution.
But with an hex editor is as simple as editing the variable type byte to an appvar? Curious to know and for me is easier than installing CelticIII and learn the command usage.
Title: Re: Axiom SDK For Developers
Post by: Quigibo on June 27, 2010, 04:37:36 pm
Yes, turning it into an appvar is as simple as changing the program type byte from $05 to $15 and renaming the file with the extension .8xv instead of .8xp

EDIT: I'd also like to make a correction to one part of the SDK, I think I uploaded the wrong version.  I am going to upload the correct version.  The initial routine section should read:

Code: [Select]
;On the other hand, if this is a subroutine with 1 or 0 arguments then this
;part of the Axiom must be ignored since there is no popping needed.
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on June 27, 2010, 09:00:00 pm
A bit lost here: What is Axiom going to be? Is it a library for the Axe language or for ASM itself, and how would it be used? Sorry, I couldn't find any page describing it.
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 27, 2010, 11:14:28 pm
Yes, turning it into an appvar is as simple as changing the program type byte from $05 to $15 and renaming the file with the extension .8xv instead of .8xp
Thanks for that tip. Can the former be easily done through CalcSys?
Title: Re: Axiom SDK For Developers
Post by: calc84maniac on June 27, 2010, 11:44:18 pm
Yes, turning it into an appvar is as simple as changing the program type byte from $05 to $15 and renaming the file with the extension .8xv instead of .8xp
Thanks for that tip. Can the former be easily done through CalcSys?
Yeah, you have to find the program in the VAT (press 6,1,1 from the main menu iirc). Select its entry and press Alpha+V. The hex editor should then be pointing directly at the byte to change
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 27, 2010, 11:52:54 pm
Aaah ok, thanks for the info :)
Title: Re: Axiom SDK For Developers
Post by: Galandros on June 28, 2010, 05:09:10 am
A bit lost here: What is Axiom going to be? Is it a library for the Axe language or for ASM itself, and how would it be used? Sorry, I couldn't find any page describing it.
It is a library for Axe Parser in assembly. In the Axiom you define what token will make use of an assembly routine coded into the appvar.
In the source code (Axe Parser) you use the token you assigned to a certain routine (tilemapper, math...) just like another command.
In the compiled program the assembly routine is included.

With this you don't need to make inline assembly because it is actually an addin into the Axe Parser compiler.
It has the advantage over inline assembly for readability and any casual coder won't notice he is using an assembly library, he just sent an appvar into his calc, read the documentation and uses it. Still breaks the rules to the contest because it would allow cheating with hand written assembly, but maybe in the future some contests will allow certain Axioms. (Axe Parser with Axioms)

Quigibo, you really know how to give cool names. (Axioms and Axe Hax) :P Where did the Axioms came from? It sounds a bit like Axe.
Title: Re: Axiom SDK For Developers
Post by: Quigibo on June 28, 2010, 11:15:08 am
I don't know, I liked the word "Axioms" becasue that is a word used to describe the fundamental building blocks of mathematics, and in the same way, the Axioms in Axe are also like the building blocks of Axe programming (if you include the majority of the existing routines which are templated in a very similar way as the Axioms) not to mention it sounds like Axe which probably contributed more to me picking that name :P
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 28, 2010, 11:40:25 am
I personally like the name. It sounds quite good too it seems and it's best to keep names close to the language name so people think "hey, it's for Axe, right?"
Title: Re: Axiom SDK For Developers
Post by: calc84maniac on June 28, 2010, 11:42:12 am
I personally like the game.
Darn it, I lost :(
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 28, 2010, 11:50:11 am
GAH! Major typo of my part.

Altough I am somewhat happy in a way because one of my typo made someone lose the game ;D

Fixed, tho. I meant "name" :P
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on June 28, 2010, 09:03:16 pm
A bit lost here: What is Axiom going to be? Is it a library for the Axe language or for ASM itself, and how would it be used? Sorry, I couldn't find any page describing it.
It is a library for Axe Parser in assembly. In the Axiom you define what token will make use of an assembly routine coded into the appvar.

Libraries! Brilliant idea! And it's all written on-calc, right?
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 28, 2010, 10:52:11 pm
Not the ASM code, unless you use OTBP assembler (or in the future, SirCmpwn's Mosaic project).
Title: Re: Axiom SDK For Developers
Post by: Quigibo on June 29, 2010, 12:57:17 am
Unfortunately, I just realized that there is going to have to be one additional restriction.  Each Axiom will have a maximum number of subroutines (but still unlimited replacements).  The number right now is 32.  I can increase this number in the future if I reduce the number of total Axioms allowed per program but I think this limit is acceptable as it is.   To give some perspective, the entire parser currently has 29 built-in subroutines which includes all the typical functions as well as all the operations such as multiplication and division.
Title: Re: Axiom SDK For Developers
Post by: Builderboy on June 29, 2010, 01:20:57 am
Wow, only 29 so far?  Could have sworn it was more ;D Well in that case 32 should be more than enough :) Since a single Axiom could more than double the amount of sub's available to a program :O
Title: Re: Axiom SDK For Developers
Post by: Raylin on June 29, 2010, 08:36:15 am
Indeed. If this wasn't illegal in the Axe Parser contest, this feature would make adding features SOO much easier. And for a library, I nominate the Zedd Physics Library. :D
Title: Re: Axiom SDK For Developers
Post by: Galandros on June 29, 2010, 10:03:02 am
Indeed. If this wasn't illegal in the Axe Parser contest, this feature would make adding features SOO much easier. And for a library, I nominate the Zedd Physics Library. :D
Zedd Physics Library is in Axe Parser. It provides normal Axe Parser subroutines.
But it would be interesting assembly libs for fast tilemapping with smoothscrooling, physics and 3D (raycaster or wireframed).
Title: Re: Axiom SDK For Developers
Post by: Raylin on June 29, 2010, 10:33:13 am
^++
Agreed and seconded.
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on June 29, 2010, 10:46:27 am
Indeed. If this wasn't illegal in the Axe Parser contest, this feature would make adding features SOO much easier. And for a library, I nominate the Zedd Physics Library. :D
Zedd Physics Library is in Axe Parser. It provides normal Axe Parser subroutines.
But it would be interesting assembly libs for fast tilemapping with smoothscrooling, physics and 3D (raycaster or wireframed).

It's part of the app already?
Title: Re: Axiom SDK For Developers
Post by: Galandros on June 29, 2010, 10:55:54 am
Indeed. If this wasn't illegal in the Axe Parser contest, this feature would make adding features SOO much easier. And for a library, I nominate the Zedd Physics Library. :D
Zedd Physics Library is in Axe Parser. It provides normal Axe Parser subroutines.
But it would be interesting assembly libs for fast tilemapping with smoothscrooling, physics and 3D (raycaster or wireframed).

It's part of the app already?
I was ambiguous, sorry. The Zedd Library is coded in Axe Parser (language) by Builderboy.
You include the routines you need into your source code.
Title: Re: Axiom SDK For Developers
Post by: nemo on June 29, 2010, 11:13:26 am
i mentioned this earlier, but didn't get any replies. would anyone be interested in making an axiom for string output from reading the RAM of L1?
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 29, 2010, 11:19:24 am
Do you mean storing to TI-BASIC string vars?
Title: Re: Axiom SDK For Developers
Post by: nemo on June 29, 2010, 11:21:33 am
yes, DJ. basically i'd like an axiom that would read data from L1 and store it to a TI BASIC string var, or Ans. i just want it so i can RCL it later, because i'd be using it for a tilemap editor, and copying a tilemap by hand is a pain in the ass.
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on June 29, 2010, 11:31:01 am
That would rule and I agree. One for individual sprites of any format would rule too. Runer112 sprite editor is nice but it's annoying to have to manually copy each hex strings char by char manually. Either a routine that does that or a new Axe command that lets you do that would be nice
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on July 17, 2010, 11:12:29 pm
And another question: Are we allowed to overload commands (meaning making an Axiom for a command already part of the parser)?
Title: Re: Axiom SDK For Developers
Post by: Quigibo on July 17, 2010, 11:31:54 pm
It is not possible to overload built-in commands because they're higher on the parsing hierarchy.  However, You can overload other Axioms by declaring your axiom ahead of the others.

Unfortunately, this leaves the possibility of new Axe Parser commands overloading your existing Axioms as new versions come out which is why I don't think you will see many Axioms until the entire Axe language is completed and then the remaining gaps need to be filled.
Title: Re: Axiom SDK For Developers
Post by: Eeems on July 17, 2010, 11:41:47 pm
Have you thought about adding double token replacing? something like an Axiom has it's own token and then you just have your next one something like bal(Output( so you can have even more tokens?
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 18, 2010, 09:40:32 pm
I wonder if that would be easy to implement?
Title: Re: Axiom SDK For Developers
Post by: Quigibo on July 19, 2010, 12:20:36 am
I think that would just be confusing especially since it used 2 sets of parenthesis.  The reason I can't have custom names for the Axiom tokens is a lot more complicated than that.  Probably what I will do is have a set of tokens (For instance, the 12 parametric tokens) be named really generic things like Draw1(), Draw2(), Swap(), In(), Out(), New(), Delete() etc. that are specifically reserved for axiom use.
Title: Re: Axiom SDK For Developers
Post by: Builderboy on July 19, 2010, 01:11:08 am
That sounds like a really good idea.  Will there be any way to create Axioms using the Axe language itself?  Like if somebody wanted to write a physics library in Axe and allow other people to use it. (Im *totaly* not talking about Zedd ;) )
Title: Re: Axiom SDK For Developers
Post by: Quigibo on July 19, 2010, 01:21:08 am
Hmm... although it is technically possible, I was thinking I would just have a different way to add subs form external program data.  But that would be cool to have an option to compile for Axioms.  The only problem is that the current Axioms are too primitive to handle axe calls right now, but that is something I will definitely add later.  I will play around with this idea and see if it's possible.
Title: Re: Axiom SDK For Developers
Post by: Builderboy on July 19, 2010, 01:24:24 am
Ah, the other solution works too :) i'll have to look into current Axioms more in depth...
Title: Re: Axiom SDK For Developers
Post by: calcdude84se on July 19, 2010, 11:35:22 am
Being able to use other Axe programs as external libraries would definitely be useful, especially since the only real way to do it right now is to recall the library to the end of every program that needs it.
Compiling to Axioms would be nice too, since you could use tokens to call routines rather than using sub( a lot.
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 19, 2010, 09:27:45 pm
I agree with Calcdude. External libs will make our code cleaner and may make it easier to work on multiple versions of a program at once (example: French translation)

For Axioms I like the token idea by Quigibo.
Title: Re: Axiom SDK For Developers
Post by: Eeems on July 19, 2010, 11:54:38 pm
I like both ideas :)
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on July 21, 2010, 04:27:16 am
External subs ... that'd be nice, but would the sub be compiled or not? Maybe Axe could include a "subroutine compiler" specifically to make them?

EDIT: Maybe instead of Axioms in the Axe language, Axe could support a different format that could be compiled into an Axiom?
Title: Re: Axiom SDK For Developers
Post by: calcdude84se on July 21, 2010, 10:05:54 am
We have to have Axioms written in Axe. I don't think we want to learn another format. Unless of course you mean having tokens to delimit the routines in an Axe Axiom, which is fine. :) (As a technical note, Axioms written in Axe will all probably need to be of the kind that are automatically made into subroutines.)
Do you mean precompiled? They have to be compiled in the end. :P Having them precompiled might not work unless the compiler can generate the equivalent of an ASM list file, which defines labels for external use. A separate compiling mode will probably be necessary for precompilation, but I wouldn't want a whole new compiler. ;D
Title: Re: Axiom SDK For Developers
Post by: Happybobjr on July 21, 2010, 10:29:04 am
sorry for  this but i can't figure out what and how axiums are used.
they are .z80... but you can't send .z80's to  your calculator (am i right), so how can they be used?
Title: Re: Axiom SDK For Developers
Post by: calcdude84se on July 21, 2010, 10:31:35 am
Axioms are written in assembly, the file extension for which is .z80 or .asm
You use an assembler and possibly another tool to assemble them and turn them into .8xp files, which can be sent to your calc.
If you don't know ASM and want to learn, TI-83+ Assembly in 28 Days or Hot_Dog's ASM for the absolute beginner are recommended
Edit: http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/toc.html (http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/toc.html) is a link for the first :)
Title: Re: Axiom SDK For Developers
Post by: Happybobjr on July 21, 2010, 10:38:27 am
thanks much.  it can't be harder than learning ti-basic by yourself without and kind of help (just for fun).  There were so many syntax errors to start with :P
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 21, 2010, 12:22:20 pm
True, unless you have been doing BASIC for an incredible amount of time and just can't get used to low level stuff. In my case, I failed with anything other than TI-BASIC and Axe. I even spent months trying to learn ASM, split in 3 attempts (May-June 2004, Feb-March 2005 and somewhere else in 2005) as well as 68k C (through Technoplaza and another tutorial, in french, by Squale92). The thing with ASM, though, apparently, is that it's incredibly hard to learn for many people, but once you grasp the concept, it's not too hard to code. It just takes a long while to code large games since one single command is like 10 or 20 lines of code. One idea I have is to know Axe first, though, because you can understand the concept about pointers or RAM a bit easier afterward.
Title: Re: Axiom SDK For Developers
Post by: Happybobjr on July 21, 2010, 12:33:28 pm
Good advise. I will do that, thank you.  It is great having people everywhere here who are smarter than I, it helps a ton ... :}
Title: Re: Axiom SDK For Developers
Post by: calcdude84se on July 21, 2010, 12:38:18 pm
You get used to it eventually. :)
Back on topic, (well, sort of), I find it amusing that an Axiom's .org statement has value $C0DE :P
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 21, 2010, 12:46:48 pm
Really? Lol, I wonder if it was intentional or if it's a coincidence?
/me pokes Quigibo :P
Title: Re: Axiom SDK For Developers
Post by: Quigibo on July 21, 2010, 01:13:11 pm
That's not a .org statement, that's just a unique header name so you don't accidentally import an appvar that's not an Axiom because no further checks are done after that.  Its more like the $6DBB used by the TI-OS, which is the AsmPrgm token.  If I do decide to merge Axioms with external subs that would kind of invalidate its use for the contest because there would be no way to tell if the generated code was written in Axe or assembly just like the executables.  But I suppose if the source for the Axiom were released, it could be compiled using Axe to prove it.

There are other technical limitations though like a size limit for each routine.  I think to avoid those, I could have the Axioms just be source code rather than assembled code so they can compile just like regular source code.  But the other thing I dislike about merging the Axioms with external subs is that they are not easily modifiable.  If you need to make a small change to the Axiom like to change the dimensions of a tile mapper or something, you would have to have the original source code to recompile it.  But if you have to do that, I might as well just have a separate way to do external subs with the actual program itself.
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 21, 2010, 02:25:01 pm
Well... if someone used an Axiom coded in Axe, he could maybe just provide the Axe source of it to prove it's in Axe.
Title: Re: Axiom SDK For Developers
Post by: calcdude84se on July 21, 2010, 02:29:47 pm
Who suggested merging Axioms w/external subs? Not me.
They'd definitely be better separate, IMO, since they serve different purposes. Axe Axioms are considered Axioms, not external subs, right?
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 21, 2010, 05:17:56 pm
I think it was Deep, not sure tho. I think it may be best if they're separate, I think. Else it may confuse some ppl
Title: Re: Axiom SDK For Developers
Post by: Eeems on July 21, 2010, 07:32:51 pm
Edit: http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/toc.html (http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/toc.html) is a link for the first :)
Is that a link to my site I see? :P
Title: Re: Axiom SDK For Developers
Post by: calcdude84se on July 21, 2010, 07:36:06 pm
Yessir. Only online version to my knowledge ;D
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on July 21, 2010, 07:50:42 pm
THey used to be hosted by Dragon-Fire programming team but the server shutted down a long while ago. The URL was extremly hard to remember too, especially that it used a ~ x.x
Title: Re: Axiom SDK For Developers
Post by: willrandship on August 18, 2010, 06:37:49 pm
Could we host it on here? That would be nice, in case eem's server crashed and he lost it. It might be the only copy left!
Title: Re: Axiom SDK For Developers
Post by: TC01 on August 18, 2010, 06:43:23 pm
Could we host it on here? That would be nice, in case eem's server crashed and he lost it. It might be the only copy left!
Only online copy, anyway- you can still download it from ticalc.org in html (http://www.ticalc.org/archives/files/fileinfo/268/26877.html) and chm (http://www.ticalc.org/archives/files/fileinfo/364/36479.html) format.
Title: Re: Axiom SDK For Developers
Post by: DJ Omnimaga on August 20, 2010, 12:25:24 pm
Could we host it on here? That would be nice, in case eem's server crashed and he lost it. It might be the only copy left!
Er... his host is still up for me. I can browse ASM In 28 days mirror fine. Freehostia just have crappy uptime when it comes to free hosting (as they say, you get what you pay for x.x)
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 18, 2011, 04:59:38 pm
one question: when getting the variables r1 to r6 from the input, in what order are they received?  Is HL holding r1, and the rest are in order after that in the stack?  Or is it r6 in HL and opposite order in the stack?
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on March 18, 2011, 06:47:27 pm
one question: when getting the variables r1 to r6 from the input, in what order are they received?  Is HL holding r1, and the rest are in order after that in the stack?  Or is it r6 in HL and opposite order in the stack?

Axioms don't use r1-r6. r1-r6 are actual memory locations, like the A-Z vars, while the arguments of a function (that's what you're talking about, right?) are stored in this way:

The first argument is deepest in the stack, the second the second deepest, etc. Then the second-to-last argument is on top of the stack (first out), and the very last argument is in HL. As an example, say you have a function nDeriv(:

nDeriv(0,1,42,1337,9001)

When the Axiom routine takes control, 9001 is in HL. Doing a POP HL puts 1337 in HL; POPing again gets 42, then 1, then 0.
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 18, 2011, 07:41:46 pm
Thanks DT :D

also, how do subroutines work?  Do they allow for more than the 255 byte limit of routines?
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on March 18, 2011, 07:42:47 pm
Thanks DT :D

also, how do subroutines work?  Do they allow for more than the 255 byte limit of routines?

What kind of subroutines? sub( subroutines in Axe, Axe command routines (such as for DispGraph), or Axiom subroutines?
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 18, 2011, 07:44:48 pm
no, in an axiom quigibo states that you can have your normal assembly code for your axiom routine, but he also mentions subroutines applying to the regular routines (but without much explanation).

can you fill me in on how these work?
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on March 18, 2011, 07:49:05 pm
no, in an axiom quigibo states that you can have your normal assembly code for your axiom routine, but he also mentions subroutines applying to the regular routines (but without much explanation).

Wait, where is this?
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 18, 2011, 07:50:45 pm
Code: [Select]
;Sqrt(num)
.db $FF                 ;Shells
.db tSqrt,0             ;Token
.db 1                   ;Replacement Type
.db 1                   ;Arguments
.db __SqrtEnd-1-$       ;Subroutine Size
ld a,-1                 ;Subroutine Command
ld d,a
ld e,a

as compared to

Code: [Select]
.db $FF                 ;Shells
.db tDiag_off,t2ByteTok ;Token
.db 0                   ;Replacement Type
.db 0                   ;Arguments
.db 7                   ;Size
B_CALL(_RunIndicOff)    ;Command
res 5,(iy+0)

I'm positive they have different purposes, but I have no idea how they work differently.
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on March 18, 2011, 07:55:24 pm
Oh, I see. It works like this:

First of all, an Axiom is a definition for a command (which you know). You could define nDeriv( to run a custom routine, for example.

Axe lets you choose whether you want your Axiom to exist as subroutines at the end of the program instead of being inserted in each place where the Axiom is called.

For example, say that routine you wrote for nDeriv( takes up 300 bytes. It would be extremely inefficient to stick that 300-byte code at every point nDeriv( is called in the program, so you tell Axe to make this a subroutine that goes at the end of the program (like sin( and DispGraph) that gets CALLed at every point nDeriv( appears.

Whereas if you have a different command that does something really simple (like in 2 bytes), you might as well not make it a subroutine and instead stick those two bytes wherever it's called.
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 18, 2011, 07:57:59 pm
ah, thanks for the clarification :)
Title: Re: Axiom SDK For Developers
Post by: Eeems on March 19, 2011, 12:17:21 am
Could we host it on here? That would be nice, in case eem's server crashed and he lost it. It might be the only copy left!
Er... his host is still up for me. I can browse ASM In 28 days mirror fine. Freehostia just have crappy uptime when it comes to free hosting (as they say, you get what you pay for x.x)
It's no longer on freehostia, although freehostia will redirect you :) It's now on eeezor.ec3club.tk which is much faster :)
Title: Re: Axiom SDK For Developers
Post by: Quigibo on March 19, 2011, 03:09:12 am
By the way Ashbad, the old Axiom system is no long supported so those don't really apply, make sure you are using the SDK that came in the Axe 0.5.0 zip file.  Also, there isn't a 255 byte limit now, they can be any size.
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 19, 2011, 06:59:05 am
thanks quigibo ;) never thought to look there for the updates :P

also, congrats on making the axiom system!  I'm extremely impressed on how it works -- yesterday I got an 8 level grayscale one to work.  It's so easy to make and use Axioms -- I LOVE it!
Title: Re: Axiom SDK For Developers
Post by: ZippyDee on March 27, 2011, 03:06:58 am
So is there currently a way to write an Axiom for something like Pt-On(_x,_y,_ptr)r?
Title: Re: Axiom SDK For Developers
Post by: leafy on March 27, 2011, 03:09:13 am
Do axioms generally run faster than generic Axe commands?
Title: Re: Axiom SDK For Developers
Post by: Runer112 on March 27, 2011, 03:09:17 am
So is there currently a way to write an Axiom for something like Pt-On(_x,_y,_ptr)r?

That routine already exists, why would you want to write a new one? Also note that in most cases, you can't use tokens that Axe already uses for the built-in commands in your Axioms.


Do axioms generally run faster than generic Axe commands?

There are a few things that Axioms can't be used for, like control structures and auto optimizations, so these cannot be compared. For everything else, the speed of the command is simply dependent on the assembly code of the routine. If you took the code for a built-in Axe command and included it in an Axiom, both versions would result in exactly the same compiled code and run at the same speed. For other routines, the speed is simply dependent upon what the routine does, how well it was coded, and how much the programmer was aiming for speed over size.
Title: Re: Axiom SDK For Developers
Post by: ZippyDee on March 27, 2011, 03:11:22 am
I know, I meant the radians symbol as a suffix to the command and have it execute a different routine
Title: Re: Axiom SDK For Developers
Post by: Runer112 on March 27, 2011, 03:22:26 am
I know, I meant the radians symbol as a suffix to the command and have it execute a different routine

Yes. The fifth byte of every Axiom command header details specifics about how the routine is called. Here is what AxiomSDK.txt says about this byte of the header:

Code: [Select]
;____FIELD 4____
;Description:     Command type
;Size:            1 byte
;Bits:            bit 0 ==> Subroutine instead of inline routine
;                 bit 1 ==> Command requires the r modifier
;                 bit 2 ==> Command requires the rr modifier
;                 bit 3 ==> Additional argument comes before a store token

So if bit 1 of this byte was set, your routine would require one r modifier.
Title: Re: Axiom SDK For Developers
Post by: ZippyDee on March 27, 2011, 03:56:45 am
Ohhhhhhhhh okay. That makes perfect sense now. Thanks! :D
Title: Re: Axiom SDK For Developers
Post by: Ashbad on March 27, 2011, 09:18:44 am
Do axioms generally run faster than generic Axe commands?

Depends on the coding you did -- it's basically just a inline or subroutined form of assembly, so It's really hard to make a speed comparision, especially when your axioms will most undoubred have different commands at different speeds from the axe commands.
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on March 27, 2011, 10:40:23 am
I know, I meant the radians symbol as a suffix to the command and have it execute a different routine

But remember Pt-On(X,Y,PTR)r exists too.
Title: Re: Axiom SDK For Developers
Post by: ZippyDee on March 28, 2011, 06:02:16 am
I know, I meant the radians symbol as a suffix to the command and have it execute a different routine

But remember Pt-On(X,Y,PTR)r exists too.

I know, I was just using that as an example command that uses the r suffix.
Title: Re: Axiom SDK For Developers
Post by: Deep Toaster on March 28, 2011, 09:23:26 am
Oh, got it.