Author Topic: Axe Parser  (Read 492858 times)

0 Members and 1 Guest 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 #540 on: May 05, 2010, 07:29:52 pm »
I have a neat optimization idea you can use for "byte mode". Make the IX register point to the A-Z variable area and use indexing. Should save quite a bit of space since you won't have to load into a register before operating on the variables. The only problem is that the sprite routine and such would have to restore IX afterward.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #541 on: May 06, 2010, 03:26:01 am »
hmm... but its the same size to do:
ld a,(var)
and
ld a,(ix+var)
So I don't think it makes a difference.  Don't forget, the byte commands need to use the "a" register, not "hl".

By the way, I don't think my original plan to use flags for the conditionals is going to work, but at least the "and" "or" and "xor" commands are half of what they were.
___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: Axe Parser
« Reply #542 on: May 06, 2010, 02:40:52 pm »
hmm... but its the same size to do:
ld a,(var)
and
ld a,(ix+var)
So I don't think it makes a difference.  Don't forget, the byte commands need to use the "a" register, not "hl".

By the way, I don't think my original plan to use flags for the conditionals is going to work, but at least the "and" "or" and "xor" commands are half of what they were.
It does make a difference if you do
add a,(ix+var)
as opposed to something like
ld b,a
ld a,(var)
add a,b
"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: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #543 on: May 06, 2010, 10:11:55 pm »
wow nice to hear about the change. I can't wait to see the difference. Hopefully code change is not too much, I don,t think my game use the code example you posted

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 #544 on: May 06, 2010, 11:31:28 pm »
Oh yeah.  The only problem is like you said, I have to initialize it at the beginning and then preserve it throughout the code.  Its doable, but I'm not sure how easy it will be.  I'll just wait until I get to that part and then decide if it is simple enough to do it that way.  It would be 4 bytes to initialize it and then 2 bytes to preserve it each drawing command that uses it.  And since this is a very advanced feature anyway, I'm not sure how much it would be used and I don't want to add too much baggage on the normal code size.

Also, I noticed that there is a built-in bcall for division, so that should reduce the size a lot.  Even though the bcalls are generally slower, its using an 16/8 bit routine for smaller numbers instead of the standard 16/16 bit division, so it comes out to the same speed anyway.  I can also generalize this to modulus.

calc84, I have a question.  Do you know if the _HomeUp bcall is supported on all of the 83+ OS's?  I remember it used to not be in the include file or something so I don't know if it was only added after a certain point.  Maybe I'm just crazy and imagining this.

As you can tell, I've been going though the bcall list and I've found a lot of good ones.  However, I don't ever want to compromise speed so most of them won't cut it.
« Last Edit: May 06, 2010, 11:31:42 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

_player1537

  • Guest
Re: Axe Parser
« Reply #545 on: May 09, 2010, 11:12:03 am »
Where do we get the 'b' for binary numbers?  Is it just the lowercase 'b'?  If so could it be changed to something without needing the lowercase letters?  like EEbinary number, or E(r)binary number, or Ebinary number (r).  (the E's are the scientific notation 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 #546 on: May 09, 2010, 11:54:58 am »
Yeah, its the lowercase b.  I added the lowercase toggle to the parser options menu for this reason and I think lowercase letters will be used in the future.  There just simply aren't enough tokens available, let alone ones that make sense in most situations.  I also hate having the lowercase alpha on by default, but I don't mind toggling it while writing a program.  Is there another reason you're against it?
___Axe_Parser___
Today the calculator, tomorrow the world!

_player1537

  • Guest
Re: Axe Parser
« Reply #547 on: May 09, 2010, 12:08:38 pm »
It's just annoying to write code with.  IE if I use a bunch of variables and such, then if I don't have it fully thought out, I will press alpha for a variable, maybe decide I don't need a variable, and press it again.  But with lowercase alpha on then I have to press alpha 2 times, I could probably get used to it, or just do as you say and toggle it real quickly.  also, it makes editing a pain if you accidently leave alpha on and you use up or down.

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 #548 on: May 09, 2010, 12:30:27 pm »
I would recommend getting used to it becasue one of my future plans include variable aliases, which is a way to name variables like instead of S, you can call it "Score" but all letters after the first one have to be lowercase to avoid ambiguity.

Or you can be like me and just keep it off by default and only turn it on when you need a lowercase character.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #549 on: May 09, 2010, 02:12:13 pm »
One major issue with lowercase letters is that they're 2 byte tokens. Make sure to not overuse it because then source code will grow large pretty quick.

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 #550 on: May 10, 2010, 12:50:51 am »
Honestly, I don't really care how big the source is (within reason) since it will generally be smaller than the executable and it can be archived during parsing.  You would never have a 10000 byte source since the compiled program would likely be around the 16kb limit anyway.

Also, I do have finals coming up soon.  Don't expect much over the next month.  I'll still try to update every week, but there'll probably just be 2 or 3 new things in each version from now on until school ends.  Once summer hits, there will be rapid progress again and 1.0.0 will be finished before the end of summer.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #551 on: May 10, 2010, 12:55:46 am »
actually Calc84 mentionned somewhere the limit is actually 8.8 KB in Mirage. For the rest it's 8.1, but yeah I see what you mean. If you got a lot of data you migth run out of space quick, though

I hope things goes well with school and that you're not too busy afterward. It would suck to see you go D:

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 #552 on: May 10, 2010, 05:04:53 am »
I'm having a little grayscale crisis.

First of all, it needs to have constant pause times or else it looks really crappy so I can't use the screen delay timer.  If I make the pauses short enough, its speedy fast for 6MHz mode but fails on 15MHz mode.  If its too long, it looks great on 15MHz mode, but really lags in 6MHz mode.  That means, it has to pause a different amount of time depending on if its in 6MHz mode or 15MHz mode.  I can add a check to pause a different amount of time for each mode.  The check is too much code to look good on 6MHz mode unless I fix a few things.  If I use some undocumented instructions, I can speed it up fast enough to look good, but then I lose compatibility with the NSpire.  I could also skip one of the checks to speed it up, but then it still pauses the longer 15MHz pause time when using a regular 83+ thus losing compatibility with the original 83+.

So it seems like a lose-lose-lose situation right now.  I can't seem to find a way to make the routine fast enough yet still compatible with every model at every speed.  I might have to either make separate routines for each speed or just settle with the ugly "checkered" grayscale.  I don't know what to do.

And don't say I'm being too picky about quality.  If perfect gray is not reproducible, it defeats the purpose of the command since then you might as well just flash the images on and off since that flickering would be less annoying than the checkered flickering.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Axe Parser
« Reply #553 on: May 10, 2010, 06:44:35 am »
How about having a variable that tells the program what type of delay to do? I mean that for example the default state is 0 so that each time a grayscale is run, it uses the 6MHz delay. However, if you put 1 into it, then the grayscale commands will be using 15MHz delays. And maybe have it so that 2 different programs are compiled when the variable is modified.

Dunno if I made myself clear.   
Former Coder of Tomorrow


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 #554 on: May 10, 2010, 11:17:35 am »
Use HALT for delays?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman