Jump to content
IGNORED

Squeeze


Zufolek

Recommended Posts

Interesting - it looks like a generic 6502 peephole optimiser, rather than being bBasic specific. From the comments in the code, it does the following:

  1. Merges multiple loads of the same value into a single load
  2. Removes unnecessary compares with zero
  3. Removes store followed immediately by load
  4. Removes unnecessary consecutive loads and stores
  5. Removes unused code (between a jmp and a label)
  6. Removes unnecessary zero initialisation
  7. Removes unused loads
  8. Converts subroutines into jmps
  9. Converts load/tax into lax
  10. Converts and/tax into lxa
  11. Converts sequences of short jumps into a single jump

I'm not sure all of these operations are completely safe, but it looks like a useful set.

 

Chris

Link to comment
Share on other sites

I couldn't find an optimizer for 6507 assembly after a little searching, so I made this. It does many of the same assembly optimizations that I was doing to squeeze more stuff in my 4k bB games. Does anyone know of another program that works better?

 

Regardless, I've fixed some problems in Squeeze so it should work with more games, and I've added a simple uninstaller. I've fixed a syntax error when calling the modified 2600bas.bat with only -O option. (My bad.)

 

I've disabled the LXA optimization since that apparently fails (at least in emus) for whatever reason.

 

The updated version (0.2) is on the first post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...