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 > Opcode Execution time != cpu cycles?
2012-02-05 14:37
Flavioweb

Registered: Nov 2011
Posts: 463
Opcode Execution time != cpu cycles?

As writed at: http://www.atarimax.com/jindroush.atari.org/aopc.html#TIMES

"
Execution Times

Op code execution times are measured in machine cycles, one of which equals two clock cycles. Many instructions require one extra cycle for execution if a page boundary is crossed; ...
"

This mean that using a Cia timer setup to count system cycles and supposing to starting it just after an LDA #$00 instruction and reading it again (the timer value) after instruction execution, since LDA time is 2 machine cycles the timer value can be 4 (or better... to have a timer value of "0" we need to setup it for starting at 4)?
 
... 10 posts hidden. Click here to view all posts....
 
2012-02-06 21:50
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: also that is completely irrelevant unless you are trying to use the timer value right before it wraps. i cant tell any practical situation where this is true right now to be honest :o)

When using a timer to stabilize a raster it can be confusing if you assume the value 0 exists... :) But yeah... not really relevant in most cases indeed.
2012-02-06 21:55
Copyfault

Registered: Dec 2001
Posts: 478
Mainly I wanted to point this out because I think it helps a lot - at least it would've helped me back then ;)

In practice it could help to do a smart dejitter routine. This "zero state = init value"-thingie forced me to use the illegal asr-opcode ;)
2012-02-06 22:06
chatGPZ

Registered: Dec 2001
Posts: 11386
or just start the timer one cycle later perhaps? =P
2012-02-07 07:16
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: or just start the timer one cycle later perhaps? =P

Totally off-topic of course, but since I formulated a problem and you posted a solution (the one we all use), it's not completely irrelevant knowing that the timer actually doesn't reach 0. :)
2012-02-07 08:56
chatGPZ

Registered: Dec 2001
Posts: 11386
i have used timers for stable raster long before i knew about the wraparound bug though :)
Previous - 1 | 2 - 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..
LDX#40
Mibri/ATL^MSL^PRX
Fred/Channel 4
theK/ATL
Luca/FIRE
rexbeng
Guests online: 95
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 Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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