Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Optimizing tricks
2012-03-14 08:52
Bitbreaker

Registered: Oct 2002
Posts: 508
Optimizing tricks

Hi folks,

I put together a few optimizing tricks for 6502, including a section about illegal opcodes. Anything else i could mention there? Especially the illegal opcode section could need some more examples and opcodes discussed i guess? Any mistakes?
http://www.codebase64.org/doku.php?id=base:advanced_optimizing

Bitbreaker
 
... 20 posts hidden. Click here to view all posts....
 
2012-04-25 07:21
Bago Zonde

Registered: Dec 2010
Posts: 29
LDA $1000,Y will takes 4+1 and STA $1000,Y allways takes 5 cycles.

-------------------------------------------------------------
www.commocore.com
2012-04-25 09:14
Bitbreaker

Registered: Oct 2002
Posts: 508
Oh right, it is STA, than it was right to not add a hint on that :-) Penalty cycle of course only applies to loading operations that add an index to a 16 bit address. Means ($xx),y $xxxx,x $xxxx,y
Applies for AND, ADC, SBC, ORA, EOR, CMP, LDA, LDX, LDY.
Same goes for branches if they cross a page boundary.
2012-04-25 13:44
Skate

Registered: Jul 2003
Posts: 494
am i the only one who thinks Cruzer's reminder was enough. :)
2012-06-10 20:53
Jak T Rip

Registered: Feb 2002
Posts: 39
Excellent stuff, Bitbreaker!

I included my favourite BIT trick to ignore upcoming commands:
        beq +
        lda #$04
        .byte $2c
+       lda #$05
        sta somewhere
        rts


I learned this from the Omikron reassembler that uses this technique.
2012-06-11 08:42
Bitbreaker

Registered: Oct 2002
Posts: 508
@Jak T Rip:
this trick also occurs in the kernal, however it does not save cycles (what the article is aiming for), but making things slower. It is a good thing however if you need to make your code small, no doubt. Depending on the range of values also a simple lookup table might do the trick.
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Peacemaker/CENSOR/Hi..
Oxbow/Xenon
ΛΛdZ
Chesser/Blazon
B.A./QUANTUM
Sepa/OCD
theK/ATL
tlr
Guests online: 88
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.057 sec.