• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 552833 times)

0 Members and 4 Guests are viewing this topic.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Axe Parser
« Reply #1365 on: October 16, 2010, 06:25:55 pm »
i'm not sure if it's more optimized than just A->C: B->A: C->B, though.


Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1366 on: October 16, 2010, 06:59:25 pm »
It's definitely less optimized than that, but I guess it's nice to not have to worry about having a variable to switch them through that you don't need for other things. Although I doubt a program will be using every single byte of safe RAM areas, so it would probably be easiest to just designate a 2-byte pair in a safe RAM area for things like that.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Parser
« Reply #1367 on: October 16, 2010, 07:32:25 pm »
Aha, I've been wanting this feature for a while, but I thought it might be too much trouble. It would help for interfacing with Asm(), I'm sure :)
Agreed. Perhaps use another token to represent bc, "!" perhaps? It wouldn't be as optimized, because you have to use "ld b,h \ ld c,l" rather than "ex de,hl", but it would definitely help in interfacing with assembly and using bcalls. (Also, any possibility of using a?)
When you make these things official, commands will start having to have a "destroyed" field in the documentation ;D
What about using 'e' instead of '!'? ('e' is [2nd] [/])

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Parser
« Reply #1368 on: October 16, 2010, 08:05:08 pm »
Euler's e is the bit command ;)
I'm not sure if it could work... It might be able to...
« Last Edit: October 16, 2010, 08:06:24 pm by calcdude84se »
"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 ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Parser
« Reply #1369 on: October 16, 2010, 08:06:24 pm »
Whoops, I forgot about that. ;)

I still really like the pi idea. :)

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: Axe Parser
« Reply #1370 on: October 16, 2010, 09:16:16 pm »
Even smaller and more intuitive than this:
Code: [Select]
A xor B->A xor B->B xor A->A
Is this:
Code: [Select]
A-B->A+B->B-A->A
First, A' = A - B
Then, B' = A' + B = (A - B) + B = A
Then, A'' = B' - A' = (A) - (A - B) = A - A + B = B

So you've swapped the values without any extra variable usage, and the add and subtract operations are much less code since the 16 bit xor isn't built into the z80 instruction set.  But yeah, a temporary is still smaller and faster.  In the ARM architecture, they're actually the same amount of code and speed so you can do this with no penalty.
« Last Edit: October 16, 2010, 09:18:21 pm by Quigibo »
___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: Axe Parser
« Reply #1371 on: October 16, 2010, 09:58:31 pm »
Wow, nice find!

* Deep Thought tries to understand it
« Last Edit: October 16, 2010, 10:04:16 pm by Deep Thought »




Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1372 on: October 17, 2010, 12:38:46 pm »
Quick question:

When opening files (getcalc(str,Y1) ), does the value Y1 behave like a pointer in the way that, to access the nth byte of the file, you can do {y1+n}?
In other words, is
Code: [Select]
"appvblah"->Str1
GetCalc(Str1)->A
{A+100}
the same as
Code: [Select]
"appvblah"->Str1
GetCalc(Str1,Y1)
{Y1+100}
besides the different locations of appvar blah?
« Last Edit: October 17, 2010, 12:39:24 pm by squidgetx »

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: Axe Parser
« Reply #1373 on: October 17, 2010, 05:29:21 pm »
Yes.  Y1 can only be used in a very narrow range of commands.  You can only reference them or copy them right now.  But in the future, any command which has the format command{} should work with files.
« Last Edit: October 17, 2010, 05:29:46 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1374 on: October 17, 2010, 07:41:28 pm »
Cool, thanks.
* squidgetx goes off to figure out the old way of accessing nibbles

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: Axe Parser
« Reply #1375 on: October 18, 2010, 08:32:45 pm »
Just in case, it was A/16 for the top and A^16 for the bottom.




Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Axe Parser
« Reply #1376 on: October 19, 2010, 07:40:33 pm »
quigibo, i noticed that
Code: [Select]
3->{L1}
->{L1+1}
->{L1+2}
is more optimized than
Code: [Select]
3->{L1}
Fill(L1,3)

when is the point where the latter becomes more optimized?


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: Axe Parser
« Reply #1377 on: October 19, 2010, 07:45:09 pm »
Oh, and a feature request: automatically making things like Output(0,0) be equivalent to Output(0) (and Output(0,0,"ERKH") be equivalent to Output(0):Disp "ERKH"). In other words, making it automatically calculate the full two bytes as it compiles.




Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Parser
« Reply #1378 on: October 19, 2010, 08:42:26 pm »
I know that Axe came out long time ago...
But what is the pro of the axe over basic?(Or am I so stupid to ask this kind of question?)
If it's better, can you tell me where the tutorial for it is?
Sig wipe!

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Axe Parser
« Reply #1379 on: October 19, 2010, 08:57:58 pm »
The pro(s) of axe over basic are many; speed, sprites, relatively easy greyscale, buffer shifting, and so much more.
As for a tutorial I believe one is included with the Zip file, and I think SirCmpwn was working on one but I don't know the status of it.