Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Quigibo

Pages: 1 ... 40 41 [42] 43 44 ... 135
616
The Axe Parser Project / Re: Features Wishlist
« on: December 31, 2010, 05:19:50 pm »
Return already has a ReturnIf and Return!If version.  But I guess I could still optimize it anyway in case someone forgets.

617
The Axe Parser Project / Re: Axe Parser
« on: December 30, 2010, 03:58:52 pm »
Wow!  The results are already out?!?  O.O

That is so cool!  I can't believe it was by such a big margin too, I really thought it was going to be close. Thanks everyone for all the support, I couldn't have done it without you guys.  From the beginning I never thought it would take off like this and actually be this popular and especially this early in development since a stable version still isn't out yet.  Also, I've noticed that more than half of the new 83/84 assembly programs being released currently are written in Axe and its not just forum members here either.  So I think the project has been quite successful overall  ;D

Also, its great how each of the top 4 nominees ALL had their own programming language or language extension!

618
The Axe Parser Project / Re: Axe Parser
« on: December 30, 2010, 05:29:04 am »
Sure:

Code: [Select]
:0->A->{L1+6}
:length(Str1)->L
:While A<L
:Copy(Str1+A,L1,6)
:Disp L1,i
:A+6->A
:End

You just copy the part of the string you want to display to another buffer (and end that buffer with a zero) and then just Disp that buffer.

619
Axe / Re: The Optimization Compilation
« on: December 29, 2010, 08:45:05 pm »
Oh you're right.  But I just realized that your other optimization doesn't work either. You cannot do this for AND:
Code: [Select]
!If A-EXP1 + (B-EXP2)This doesn't work because there are more solutions than there should be.  For instance, if A were EXP2 and B were EXP1 the expression would be zero when it should be non-zero.

But you can do this for a compound OR:
Code: [Select]
If A=EXP1 + (B=EXP2)
And you can do this for a compound AND:
Code: [Select]
!If A-EXP1 [16-bit or] (B-EXP2)
And speaking of optimizations.  One major optimization that usually gets ignored is recycling large axe commands.  Axe is not like BASIC and so each command needs its own subroutine to add to your program.  For instance, lets say you use Pt-On() and Pt-Mask() in your code.  Each one has to bring its own 100+ byte subroutine into your program.  But you can probably get away with having just a Pt-Mask routine, recycling it to act like Pt-On by simply adding a 2nd layer to your sprite which is only 8 bytes extra instead of 100ish.  Or you could do the opposite too and only have Pt-On() and Pt-Change() to manually change both buffers at once.  This generally reduces the overall size of the program by a lot when you use the routines only once or very rarely in your code.  And I don't mean calling it rarely, it could be the most used routine in your code, I just mean rarely appears in your source.

More examples: You can draw pixels and boxes with just sprite commands.  Boxes can be drawn with just pixels or lines.  Strait lines can be drawn with just boxes or pixels.  Its best if you only have one type of DispGraph in your all your code.  Pre-flip sprites so you don't need the flip commands in your code.  etc.

The only downside is that it slightly reduces the speed since its not as specialized but its usually worth it because you save a lot of memory, especially in smaller programs.

620
The Axe Parser Project / Re: Features Wishlist
« on: December 29, 2010, 02:18:03 pm »
For the goto-if and goto-!if I think I will auto-optimize the existing commands instead of creating entirely new syntax.  It would actually be easier I think to read and write and no one would have to change their syntax.  Same thing with sub().

621
Axe / Re: The Optimization Compilation
« on: December 29, 2010, 02:14:09 pm »
By the way, you can't have non-constant data as part of the Data() command.  And that whole inData() optimization only works for comparisons with numbers between 0-255.  You can optimize it to this always though:

Code: [Select]
!If A-EXP1 [16bit and] (A-EXP2)

622
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: December 29, 2010, 04:32:35 am »
You guys won't believe this, but I found an optimization to the general multiplication.  O.O

Code: [Select]
;#####  OLD  #####
p_Mul:
ld b,h
ld c,l
ld hl,0
ld a,16
__MulNext:
add hl,hl
rl e
rl d
jr nc,__MulSkip
add hl,bc
jr nc,__MulSkip
inc de
__MulSkip:
dec a
jr nz,__MulNext
ret
Code: [Select]
;######  NEW  ######
p_Mul:
ld c,h
ld a,l
ld hl,0
ld b,16
__MulNext:
add hl,hl
rla
rl c
jr nc,__MulSkip
add hl,de
adc a,0
jr nc,__MulSkip
inc c
__MulSkip:
djnz __MulNext
ret

Its a small optimization, its the same size as the original but it saves an average of 4 clock cycles per bit of the multiplication.  Since its a 16 bit multiplication, that's an average of 64 clock cycles (11 micro-seconds) and about a 6% increase in speed.  So its not that big of a deal, I was just really shocked I was able to optimize it.

623
The Axe Parser Project / Re: Features Wishlist
« on: December 28, 2010, 10:25:46 pm »
Back from my trip!

Multi-line comments is a good idea, I must have forgotten about it.  I like the original idea of "..." as the start and end since that reminds me of how python does it and you don't have to go into any menus to get the tokens so its easier to type.

Break and Continue are still maybes mostly because I would have to create new tokens for them and they wouldn't be in convenient places next to the other program flow commands.  I'm mostly going to be working on the Axiom support for the next few days since I feel that's most important (After that, anyone can add whatever command you want to the language)

624
The Axe Parser Project / Re: Bug Reports
« on: December 28, 2010, 10:15:44 pm »
Its not a bug.  Any line drawing off-screen is undefined behavior so it's up to the programmer to clip the lines themselves.  It just happened to optimize better this way with the new routine.  And that may change again in the future, I am considering just exiting the routine and drawing nothing instead of the modular clipping I have now.

625
The Axe Parser Project / Re: Axe Parser
« on: December 26, 2010, 05:16:53 am »
Yup, so the last of the betas is out (hopefully).  Now is the time to catch those bugs so 1.0.0 can be as bug free as possible.  I would also like to get a small group to test pre-releases so that I can be more confident in the stability.   The only requirement is that you have at least one very large file and a variety of programs to test it on.  I am also interested in an assembly programmer who wants to get a head start writing an Axiom so I can have another example to play with in addition to my mode 7 Axiom.  Examples of possible Axiom projects: CalcNet, Raycaster, DCS GUI interface, Fast Math Library, or anything else you can think of.

I'll be gone for a few days, but I'll start picking volunteers when I get back.  There will probably be a bias to more experienced Axe programmers since I only need a few.

626
The Axe Parser Project / Re: Latest Updates (***DO NOT POST HERE!***)
« on: December 26, 2010, 04:57:42 am »
Axe Parser
Delta 0.4.7


Wow, look at all these new things!

New Features:
  • Lots of new auto optimizations to reduce code size
  • Values can be stored to pointers in reverse order (big endian)
  • Display numbers in hexadecimal
  • Draw lines to the back buffer
  • New "Display & Clear" routine to do both simultaneously
  • Bitwise complement command for 8 and 16 bit numbers
  • Reallocate variables anywhere in the program!
  • Custom icon support when compiling for shells!

Changed:
  • getkey() can now take a variable as an argument!
  • Fixed bug when leaving parenthesis off inline data
  • Fixed the input command.  It should never display garbage anymore
  • New, faster line drawing routine
  • File pointers can now be dereferenced
  • The L1 buffer has changed position and is now 2 bytes larger
  • The variables are now located after the end of the L1 buffer by default

627
General Calculator Help / Re: [Help please] Mode 7.
« on: December 25, 2010, 07:54:51 pm »
Code: [Select]
:For(A,0,20)
:A*B->C
:End

Can be changed to:
Code: [Select]
:-B->A
:For(D,0,20)
:A+B->A->C
:End

And now you've removed a multiplication.  If you add rotation, you have to do 2 additions: one for the Y spacing and one for the X spacing.

628
General Calculator Help / Re: [Help please] Mode 7.
« on: December 25, 2010, 06:57:54 pm »
If you want to see the Axe version I made a while back, you can download the source code here but it doesn't have rotation.  One confusing optimization that programs like these use though is to remove the multiplication in the main loop and replace it with an addition.

629
The Axe Parser Project / Re: Bug Reports
« on: December 25, 2010, 06:25:10 pm »
Speaking of bugs I FINALLY fixed the input command.  It took quite a bit of disassembly since its not documented anywhere.  Turned out the buffer that needed to be cleared was "ioPrompt" at $8D5F.  There is even a bcall to do that.

630
TI Z80 / Re: Axe game : Avoid
« on: December 25, 2010, 06:26:51 am »
It does actually, you just have to be careful and use De Morgan's laws:

Code: [Select]
:If A=1 and (B=2)

To this:

:!If A-1 [16bit or] (B-2)

Pages: 1 ... 40 41 [42] 43 44 ... 135