• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 552118 times)

0 Members and 5 Guests are viewing this topic.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Axe Parser
« Reply #1170 on: September 06, 2010, 01:49:04 am »
yeah, i thought that too, since A now holds a value 0-255 as specified by {GDB1+X}. regardless, this is a cool way to access high/low bytes of variables


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 #1171 on: September 06, 2010, 03:16:50 am »
I was just asking Iambian how he gets grayscale to work in his project Escheron: Shadow over Ragnoth because I was wondering why it seems that every ASM game does grayscale in interrupts. Why exactly do the grayscale routines for Axe have problems with interrupts?

There is only one unfixable bug right now which is that after DispGraph commands, you need to turn interrupts back on again because they sometimes get turned off after a while.  Other than that, there is no problem with using interrupts for grayscale.  You have to use them the correct way though like the assembly programmers do.  That means your interrupt just increments a counter and your main program draws the grayscale once the counter gets to a certain point.  You can't have the 4 level routine inside of the interrupt routine itself because it uses the shadow registers for a speed optimization. But like I said, you should never be putting huge routines like that in interrupts anyway so its not a problem.

Personally though, I don't recommend them because they make the code larger and slower.  You should only use them when you are actually using them for their timing.  Games generally update the display pretty regularly anyway.  Even when there is a big variation in the amount of objects in a room, its not too hard to make the grayscale automatically adapt for that by doubling frames.

To answer the other question, this:
{L1-54}r->B

Parses identically to this:
A->B

There is no difference in the executable since this is an auto optimization.  The subtraction is during compile time.

(1)  {L1-54}
(2)  A^256
(3)  {L1-53}
(4)  A/256

In these examples, (1) and (2) do the same thing and both take 5 bytes.  No optimization there.  (3) and (4) also do the same thing, but in this case, (3) takes 5 bytes and (4) takes 6 bytes so there actually is a slight optimization.  Just for reference, r1-r6 as well as the Y0-Y9 files can also be accessed this way, but you would need the exact hex address becasue they aren't simple offsets with any of the L1-L6 buffers.
___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 #1172 on: September 06, 2010, 11:20:01 am »
quick question: do conditionals speed up execution
example
Code: [Select]
While 1
If A
blah
end
end

!if A, then will the code run almost at the same speed as if the 'blah' wasn't there? in other words, does the program 'skip' the code if the conditional is false, and is that significantly faster than actually executing it?
« Last Edit: September 06, 2010, 11:20:23 am by squidgetx »

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Axe Parser
« Reply #1173 on: September 06, 2010, 11:38:45 am »
just out of curiousity: why do you use the 'space': 0x20 in the name of the parser itself, but in the compiled versions the 'zero': 0x00 after the name?
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

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 #1174 on: September 06, 2010, 02:32:29 pm »
quick question: do conditionals speed up execution
example
Code: [Select]
While 1
If A
blah
end
end

!if A, then will the code run almost at the same speed as if the 'blah' wasn't there? in other words, does the program 'skip' the code if the conditional is false, and is that significantly faster than actually executing it?

This is true.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #1175 on: September 06, 2010, 02:59:21 pm »
thanks...

time to go on a coding spree in the last 16 hours before school starts

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #1176 on: September 07, 2010, 07:36:18 pm »
So Quigibo, does Axe use short circuit logic?  Or does it purposefully evaluate every single argument of every if Statement?

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 #1177 on: September 07, 2010, 08:01:10 pm »
Axe does not use short circuit logic.  It's not on purpose, its just that its more difficult to parse and requires it to read it as a bunch of nested blocks instead of a single statement.  I certainly would want to add it, but at this point it would break too much compatibility with previous versions.  Its something I plan to change in Axe++ which would have a slightly different syntax since it doesn't need to be completely compatible with 1.0.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #1178 on: September 07, 2010, 08:24:48 pm »
Nested blocks hmmm?  Oh well, i can program it in when i need it ^^ I just thought that assembly naturally did things lice short circuit because it used label jumps to do logic.  So i guess you do logic in a different way?

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 #1179 on: September 07, 2010, 08:27:27 pm »
Would Axe++ be some sort of new Axe language or more like an add-on?

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 #1180 on: September 07, 2010, 08:43:57 pm »
Nested blocks hmmm?  Oh well, i can program it in when i need it ^^ I just thought that assembly naturally did things lice short circuit because it used label jumps to do logic.  So i guess you do logic in a different way?
The logic is actually 8-bit bitwise logic. (This is why things like If A and B might not work as expected and you would need to use If A!=0 and (B!=0) instead)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #1181 on: September 07, 2010, 10:10:38 pm »
I think it's a completely new version of the parser.

That'd be a great idea Quigibo, by the way, since there wouldn't be compatibility issues between two versions of the same program.




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1182 on: September 08, 2010, 12:24:24 am »
I have a question: Can tempSwapArea be corrupted in ways other than directly calling Archive or UnArchive? Because I'm having problems with data corruption in L4, but nowhere in my program do I archive or unarchive anything. It might just be something wrong with my code, but I've debugged the hell out of it and it seems to be happening, although not randomly, at a certain point in execution that is executed multiple times before that successfully.
« Last Edit: September 08, 2010, 12:25:54 am by Runer112 »

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 #1183 on: September 08, 2010, 12:44:47 am »
Runer112, I don't know how tempSwapArea is actually used.  The TI Developer's guide claims its only used when archiving, but they have been wrong before.  My gut tells me its probably a bug in your program, but its certainly possible that some other bcall or interrupt could be screwing it up.  Maybe ask another asm programmer exactly what its used for if you're still not convinced.
« Last Edit: September 08, 2010, 12:45:14 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #1184 on: September 08, 2010, 12:49:27 am »
Oh, I forgot to mention: I hadn't been using L1 in my program, and replacing all references to L4 with L1 seemed to fix the problem. It seems like it's not my doing that's causing the problem, which unfortunately means I can't fix it. I really don't think I'm missing anything, but if nobody can think of anything I may just have to do more extreme debugging. :-\


EDIT: I was just browsing around randomly, and found this regarding tempSwapArea:
Quote
If you are using this area for data storage, avoid archiving any variables or using routines such as Regraph.

Maybe something besides archive and unarchive is messing with my data after all? It says "routines such as Regraph," suggesting that there are multiple routines that could corrupt data in tempSwapArea. Any ideas, anyone?


EDIT 2: I don't want to use L1 because I plan to use it later, I might use interrupts so I don't want to use L2, and L3, L5, and L6 are needed for their usual functions. Perhaps I could just use a different area of RAM? Could either appData (8000h) or ramCode (8100h) be a safe alternative?


EDIT 3: After a bit of talking with Iambian, it seems that appData should be safe to use, and the 256 bytes present there should be enough for my purposes. So I guess this issue has been avoided, but it would still be nice to solve it and determine what was corrupting tempSwapArea.
« Last Edit: September 09, 2010, 12:29:38 am by Runer112 »