Author Topic: Axe Parser  (Read 553400 times)

0 Members and 5 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #255 on: March 16, 2010, 02:39:28 pm »
This?

Quote
'CHAR'   The expression becomes the ASCII value of the single character between the apostrophes. It can even be another apostrophe.
Yep, that would be it. Like, if you read a byte, B, from a string you can check to see if it is "A" by doing:
Code: [Select]
If B='A'instead of the more cryptic
Code: [Select]
If B=65
This really helped the readability of my BrainF*** compiler
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #256 on: March 16, 2010, 02:48:59 pm »
Thanks

Not sure if I get how EHEX works, though. Does it converts a base 10 number to hexadecimal or vice-versa?
« Last Edit: March 16, 2010, 02:49:45 pm by DJ Omnimaga »

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Axe Parser
« Reply #257 on: March 16, 2010, 04:14:27 pm »
okay, i know i must sound like a huge idiot for asking this, but how does axe work? for my calc at least, i just load up the app, select one of my programs and it give me an error. and the parsing doesn't seem to work for me. do i have to activate something?
remember me as a time of day...

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Axe Parser
« Reply #258 on: March 16, 2010, 04:20:58 pm »
Well it you have to use the Axe specific syntax ONLY in your program. You can't have any BASIC Syntax whatsoever, so that could be the problem.
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Axe Parser
« Reply #259 on: March 16, 2010, 04:33:05 pm »
ohhh. yeah, i thought it just automatically converted. so once i make it all axe syntax, i just run it through the application and then run it like a normal program? or do i have to run it with asm(    ?
« Last Edit: March 16, 2010, 04:33:19 pm by Gale »
remember me as a time of day...

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Axe Parser
« Reply #260 on: March 16, 2010, 04:34:10 pm »
Yes once you convert it to Axe syntax, you run Axe App, and then you do Asm(prgmLOL
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Axe Parser
« Reply #261 on: March 16, 2010, 04:34:59 pm »
okay thanks :)
remember me as a time of day...

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Axe Parser
« Reply #262 on: March 16, 2010, 04:44:45 pm »
No problemo
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

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 #263 on: March 16, 2010, 06:24:28 pm »
Quigibo, can you show another example using the int( command?  I can't figure out how to use it, and I'd like to know how. :)

DJ, EHex just puts the hex number into Base 10.  Here are some examples:
E0001 = 1
E0009 = 9
E000F = 15
EFFFF = 65535
E001F = 31
All it does is convert from base 16 to base 10.  Does that make sense?
Note: Remember it must be 4 characters long after the E:)

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 #264 on: March 16, 2010, 06:37:02 pm »
More generally, here is what int(x) does:

if 0<x<127, then
int(x)=x
if 128<x<255, then
int(x)=x-256

(those should be "less than or equal to" signs)
So it turns 255 into -1, 254 into -2, 253 into -3... but keeps positive bytes the same.
___Axe_Parser___
Today the calculator, tomorrow the world!

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 #265 on: March 16, 2010, 08:46:28 pm »
Hmm, I see.  Can you give an example when this would be useful?  I can't come up with anything, but I'm sure it's useful when used right. :)

On a side note, the documentation doesn't include the { and }.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #266 on: March 16, 2010, 11:55:13 pm »
aaah I think I see now. I'll need to restudy these some more. Compiling them in one area (like the doc) will come very handy once Axe is out to public :)

Thanks for the help!

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 #267 on: March 17, 2010, 02:03:23 pm »
The {} actually are in the doc in the middle, but I am getting the feeling that the doc is starting to get so large, that I really should divide it into categories like Math, Data, Constants, etc. to make individual commands easier to find.

int() is almost always used with {}, in fact, I might even change it to imply the brackets.  But right now, its like this:

say you have a data structure like this:
[-2,-1,0,1,2]
And you want to display 2 more than the number so your program looks like this:

-2->{L1}
-1->{L1+1}
0->{L1+2}
1->{L1+3}
2->{L1+4}
For(A,0,4)
Disp {L1+A}+2>Dec
End

Try it.  It doesn't return the right number since even though FF is -1 for an 8 bit number, it is actually 00FF as a 16 bit number.  That value is 255, not -1 as a 16 bit.  So we need to extend the sign.  In general, that means that 00xx has to become FFxx so our 00FF becomes FFFF which IS -1.  This is the low level explanation.  You don't need to know the technical details of HOW it works, just know that it preserves the sign when reading bytes in RAM.

Now try this:

-2->{L1}
-1->{L1+1}
0->{L1+2}
1->{L1+3}
2->{L1+4}
For(A,0,4)
Disp int({L1+A})+2>Dec
End

Tada!
« Last Edit: March 17, 2010, 02:06:21 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #268 on: March 17, 2010, 02:53:33 pm »
aaah ok I see, I'll try more later :)

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 #269 on: March 17, 2010, 04:44:29 pm »
Ah, I see! Thanks! ;D

This could really help me with compression! :D
« Last Edit: March 17, 2010, 04:46:01 pm by ztrumpet »