Author Topic: Features Wishlist  (Read 607076 times)

0 Members and 2 Guests are viewing this topic.

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: Features Wishlist
« Reply #480 on: April 12, 2010, 02:41:52 am »
Well, /2 is optimized and so is /256.  /4 is not since its 8 bytes.  A load and call to the subroutine is only 6.  If you want a speed optimized command instead of a size one, you can just do /2/2 and chain them for higher powers of 2.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Will_W

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +1/-1
    • View Profile
Re: Features Wishlist
« Reply #481 on: April 12, 2010, 02:45:37 am »
Very nice, multiplication too?  And rotation commands?
ex de,hl
ld (hl),e
inc hl
ld (hl),d
ld a,(hl)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #482 on: April 12, 2010, 03:28:18 am »
Well, /2 is optimized and so is /256.  /4 is not since its 8 bytes.  A load and call to the subroutine is only 6.  If you want a speed optimized command instead of a size one, you can just do /2/2 and chain them for higher powers of 2.
So /2, /16, /256, *2, *16 and *256 are optimized, right?

I personally optimize for speed most of the time. Most BASIC programmers badmouthed me for large filesize in the past due to that, but I did not want Reuben Quest to run at like 1 fps on a SE for example. If size is really a concern, I would most likely go for the slower method, though.

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: Features Wishlist
« Reply #483 on: April 12, 2010, 03:53:29 am »
The full list is included in the zip file in the optimizations file.  I know its easy to miss, so here is a copy of it:

Code: [Select]
================================================
List of expressions with automatic optimizations
================================================
Expression______Bytes___________
+VAR            5
+CONST          4
+1              1
+2              2
+3              3
+256            1
-VAR            7
-CONST          4
-1              1
-2              2
-3              3
-256            1
*VAR            7 + sub
*CONST          6 + sub
*2              1
*3              4
*4              2
*5              5
*6              5
*7              6
*8              3
*9              6
*10             6
*12             6
*16             4
*32             5
*64             6
*256            3
/VAR            7 + sub
/CONST          6 + sub
/2              4
/128            5
/256            3
^VAR            7 + sub
^CONST          6 + sub
^2              5
^4              6
^8              6
^16             6
^32             6
^64             6
^128            4
^256            2
=VAR            12
=CONST          11
=SHORT          10
=0              8
=1              8
=/=VAR          12
=/=CONST        11
=/=SHORT        10
=/=0            7
=/=1            8

SHORT means less than 256 bytes
CONST means any size
=/= is a "not equal sign"

I'm aware there's more I can add, I'm just focusing on other more important things at the moment.
« Last Edit: April 12, 2010, 04:09:15 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #484 on: April 12, 2010, 04:01:50 am »
Oh I didn't knew this is what it was about x.x. The second column confuses me. Is it the amount of memory each of those takes, or is it the amount of memory saved by using them over something else?

EDIT: nvm, looking at the multiplications, I think I get it, now. Some of those seems to take a lot of memory o.o does this means A/2 would take 4 bytes total or 4 bytes for the /2 plus the amount of bytes for the A part of the code?
« Last Edit: April 12, 2010, 04:03:56 am by DJ Omnimaga »

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: Features Wishlist
« Reply #485 on: April 12, 2010, 04:11:39 am »
Yeah it doesn't account for the variable loading.  Its 3 bytes to load variables or constants before you actually do the operation.

Also Axe is much much much faster than BASIC.  Remember that it requires a whole new mindset.  The only time you ever have to worry about speed is with very intensive drawing and computation.  For instance more than 20 sprites with collision detection, event handling, and maybe some AI code.  And even then, the speed increase is usually a very small fraction of the total cycles.  Most cycles go into displaying sprites usually.  That's why I always optimize for size.

And of course I say "usually".  You can always optimize these things yourself even though its not automatic.
« Last Edit: April 12, 2010, 04:14:04 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #486 on: April 12, 2010, 04:17:19 am »
Yeah speed wise I really meant games with a lot of stuff moving around like your space shooter. I guess the best way would be to try out and if I find the speed gain to not be signifiant enough (especially if I have to slow the game down) I will just go with size.

Offline Will_W

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +1/-1
    • View Profile
Re: Features Wishlist
« Reply #487 on: April 12, 2010, 11:46:05 am »
Does Axe have rotation and bit logic?
ex de,hl
ld (hl),e
inc hl
ld (hl),d
ld a,(hl)

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Features Wishlist
« Reply #488 on: April 12, 2010, 01:18:13 pm »
It needs to.
:D
:D
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #489 on: April 12, 2010, 02:03:51 pm »
What would be bit logic?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #490 on: April 12, 2010, 02:08:44 pm »
It means the "and", "or", and "xor" commands that work bit-by-bit (which is the default in Axe). I also assume he means bit shifting (which are *2 and /2 in Axe). There is no bit rotation command, though (but seriously, even C doesn't have that)
"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: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #491 on: April 12, 2010, 02:10:12 pm »
aaaah ok. Wouldn't that be complicated to use, though? x.x

Offline Will_W

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +1/-1
    • View Profile
Re: Features Wishlist
« Reply #492 on: April 12, 2010, 02:11:12 pm »
Oh?  I didn't know C didn't have that.  Guess there's no real need of it in Axe then.
ex de,hl
ld (hl),e
inc hl
ld (hl),d
ld a,(hl)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #493 on: April 12, 2010, 02:13:42 pm »
What would be an example (maybe some sort of Axe pseudo code) of it in action and example of what it would do?

Offline Will_W

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +1/-1
    • View Profile
Re: Features Wishlist
« Reply #494 on: April 12, 2010, 02:17:00 pm »
Take the byte 11010100 and rotate it to the right one through carry, and you get 01101010. 
ex de,hl
ld (hl),e
inc hl
ld (hl),d
ld a,(hl)