Author Topic: Axiom structure  (Read 8290 times)

0 Members and 3 Guests are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Axiom structure
« on: November 12, 2010, 11:49:21 am »
How are the new Axioms going to be structured? Is there any special formatting that has to be done as compared to normal ASM programs? And is there a way to specify that an entire Axe code block should be parsed by an Axiom?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

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: Axiom structure
« Reply #1 on: November 12, 2010, 05:34:05 pm »
Yes, there are going to be some special formats.  I am still working on them right now, but I can give you a little preview.

First of all, each axiom you add will need a header to indicate the size of the axiom, the type of routine (inline or subroutine), the shells its compatible for, any variation to the structure (like ending in r or having the "stored to" format), the number of arguments the routine takes, etc.

After the header, its just regular assembly.  However, there are some convenient differences.  If you use any form of absolute jump or call with an address less than $4000, it will treat the jump as a relative jump instead of an absolute one by replacing the value.  That way, you can preceded any axiom with .org $0 and then all the absolute jumps and calls will work.  Also, numbers between $3FFF and $3F00 are special keywords for "AxeCalls" which will be replaced by the built in routines.  These aren't numbers you have to memorize, the axiom include file will come with all of these predefined for you.

In addition to defining the AxeCalls, the include file will also define the location of all the variables, free-ram locations, files, and other values of interest.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axiom structure
« Reply #2 on: November 12, 2010, 05:42:15 pm »
Cool, this sounds great. :) So basically, the assembly routines in Axe have almost no limitations now! Hmm, now that I think of it, could you parse the Asm() statements the same way? It would be nice to be able to use the JP opcode there.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Axiom structure
« Reply #3 on: November 13, 2010, 09:52:43 pm »
I like it! Question: how would arguments be accessed by the Axiom? EXAMPLE: pretend I have an axiom call: testcall(A,B,C+1). Where are the resulting values stored so that I could axess them from the ASM code (registers,etc)?
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Axiom structure
« Reply #4 on: November 13, 2010, 09:58:04 pm »
Thanks, Quigibo. Is there a way to designate a code block as belonging to an axiom?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

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: Axiom structure
« Reply #5 on: November 14, 2010, 12:19:36 am »
Arguments are stored in the stack except the last argument which is in hl.

Qwerty, I'm not sure what you mean.   If you're asking if you can make your own block statements with axioms, that will not be possible with the current axe syntax (using "End"), but I'm sure you could invent your own syntax for it with some hackish code by making a separate ending block routine.  Although debugging would be a little difficult since they would not be detected as block errors if there were one.
___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: Axiom structure
« Reply #6 on: November 14, 2010, 05:17:00 pm »
So will the earlier Axiom structure be incompatible?

Also, this is getting better and better... Any chance future Axioms could allow us to totally replace a default Axe command?




Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Axiom structure
« Reply #7 on: November 14, 2010, 05:39:28 pm »
  If you're asking if you can make your own block statements with axioms, that will not be possible with the current axe syntax (using "End"), but I'm sure you could invent your own syntax for it with some hackish code by making a separate ending block routine.  Although debugging would be a little difficult since they would not be detected as block errors if there were one.

Excellent. There are plenty of unused TI-OS commands that could be used as "End" statements. What I'm planning won't have any internal code blocks, so all I really need is one "End" statement.
« Last Edit: November 14, 2010, 05:41:45 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axiom structure
« Reply #8 on: November 15, 2010, 08:18:47 pm »
I have a question/feature request that would be quite helpful: Will Axioms be able to implement token replacements? Perhaps have the user put any Axioms used in their program on the second line, like includes, and add any token replacements defined in those Axioms to the ones already used by Axe?

The main reason I'm asking this is because I feel that once full Axiom support is added in 1.0, anyone could write Axioms for a good deal of feature additions. This would help to not only relieve the burden of feature requests on you, but also get features out much more quickly. But it's often very hard to find a fitting token for something as it is, and with an influx of more commands, I'm sure it would become even harder. Additionally, the fact that Axioms aren't standard parts of Axe and wouldn't be in the command list would make it even harder to remember/look up the right tokens for commands.

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: Axiom structure
« Reply #9 on: November 16, 2010, 05:26:08 pm »
Unfortunately, due to the way the token hook works, it would be virtually impossible to add custom token replacements.  In order for that to work, every token you type in the editor would have to scan the entire program for the Axiom() keyword, look in that file, compare against all the replaceable tokens, and then copy the new value.  This would be way too much of a delay and scrolling would be really sluggish.

My compromise is to provide a bunch of generically sounding token names that are unused by the axe language itself in hopes that they will fit into the axioms.  I will have a poll/thread for suggestions next week when I prepare for the next update, but to give you some examples I have now: Draw1() Draw2() Draw3() Setup() Move() Load() Save() New() Del() and of course in addition to these you have all the unused OS tokens.
___Axe_Parser___
Today the calculator, tomorrow the world!

SirCmpwn

  • Guest
Re: Axiom structure
« Reply #10 on: November 16, 2010, 05:27:15 pm »
Perhaps Axe itself can search for Axioms on the calculator, and just add all of their keywords, without bothering to see if it's used in the program?

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: Axiom structure
« Reply #11 on: November 16, 2010, 05:30:38 pm »
That's possible, but it would complicate things a bit becasue there would need to be an "installation" process when adding new axioms.  There could also be conflicts between multiple axioms and the vat would still need to be searched for the information file every token which would still slow it down considerably.
___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: Axiom structure
« Reply #12 on: November 16, 2010, 08:13:30 pm »
Perhaps Axe itself can search for Axioms on the calculator, and just add all of their keywords, without bothering to see if it's used in the program?

Perhaps the Axe default replacements themselves could be treated as Axiom replacements? That way everything is consistent.




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axiom structure
« Reply #13 on: November 16, 2010, 08:20:45 pm »
Unfortunately, due to the way the token hook works, it would be virtually impossible to add custom token replacements.  In order for that to work, every token you type in the editor would have to scan the entire program for the Axiom() keyword, look in that file, compare against all the replaceable tokens, and then copy the new value.  This would be way too much of a delay and scrolling would be really sluggish.

That's why my suggestion was to force the user to include all Axiom includes on the line immediately following the header. That way, you would only need to fully reload the custom token set when the user modifies the second line, and otherwise just use the modified token set like usual during normal editing. Although now that I think of it, it may be difficult to target changes in only one line of the program. An easier alternative would be to only scan for Axioms and load token replacements upon opening the program source, and not during any subsequent editing. If the user adds another Axiom into their program's source, it should be simple enough for them to quit and reopen the program to continue editing with the updated token replacements.
« Last Edit: November 16, 2010, 08:24:45 pm by Runer112 »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Axiom structure
« Reply #14 on: November 16, 2010, 08:28:43 pm »

My compromise is to provide a bunch of generically sounding token names that are unused by the axe language itself in hopes that they will fit into the axioms.  I will have a poll/thread for suggestions next week when I prepare for the next update, but to give you some examples I have now: Draw1() Draw2() Draw3() Setup() Move() Load() Save() New() Del() and of course in addition to these you have all the unused OS tokens.

So we'll still be able to change the unused OS tokens?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ