Hi. I've been working on a little project, thats actually my first one in z80 asm ever. Why im posting it here is because its finally done. I've been fighting with this little piece of code for about a month, mainly because i didn't have much time, but also because i make a lot of newb mistakes. Now after i have deleted the bad section of code and rewritten it, it worked on its first run Smile

I would like to thank ThunderBolt for helping me to find many bugs and giving me very useful hints.

Of course the game is not done yet, this is only the engine to the multiplayer final version of it.

But im still a little bit confused about the optimalization part. I have optimized everything the best i can, but i just know some of you are going to find some interesting ways to make this program faster Smile

Heres the code:
http://pastebin.com/5gQNMzHY
Hi, I am surprised nobody has responded o.O
Anyways, I am sure it could be rewritten and made faster (most codes can be), but there are a few optimisations and tricks you can use. For example, I am glad you used XOR A, but here are a few more:

Code:

cp 0   ==   or a
cp 1   ==   dec a    ;This is sometimes useful
cp 255 == inc a     ;Also sometimes useful
I'm not sure how I missed this topic the first two times around, but I'll try to make sure it doesn't happen again. I'm too tired to add much more to what Xeda said, other than pointing out that there's two types of optimizations you can make. There are line-by-line optimizations, perfectly exemplified by the three substitutions that Xeda suggested. There are also larger structural optimizations, which involve re-considering how your functions are structured, how your data is arranged and stored, and similar concerns.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement