6502 Assembly: Processor Speed?
Last Page >>bauen1(Game Moderator)
Aug. 29, 2016, 5:41 p.m.
so i'm using this to measure the cycles per second:
@wait:
phx
phy
ldx #0
ldy #0
_loop1: dex ;256*256 times ; 2 cycles = 131072
bne _loop1 ;256*256 times (255*256 times succeeds); 2 cycles (+1 if branch succeeds) = 196352
ldx #255 ;256 times ; 2 cycles = 512
dey ;256 times ; 2 cycles = 512
bne _loop1 ;255 times succeeds ; 2 cycles (+1 if branch succeeds) = 768
ply ; => 329216 cycles wasted \o/ this took ~5.5 seconds cycles_per_second=cycles/seconds
plx ; ~=> 59857 cycles per second
rts
Can anyone confirm this ? (notes: 1. i know its a terrible way to wait 2. that cycles per second is the same as the takt rate in Hz so 60000 cycles per second would be 60kHz 3. i used a rather in accurate timing measure meant 4. sorry if i used a lot of cpu when trying this 5. hopefully timing will come soon )
bauen1(Game Moderator)
Aug. 29, 2016, 5:42 p.m.
(notes:

i know its a terrible way to wait

that cycles per second is the same as the takt rate in Hz so 60000 cycles per second would be 60kHz

i used a rather in accurate timing measure meant

sorry if i used a lot of cpu when trying this

hopefully timing will come soon

i suck at markdown :/
)
bauen1(Game Moderator)
Aug. 29, 2016, 5:44 p.m.
'@wait: phx phy ldx #0 ldy #0 _loop1: dex ;256256 times ; 2 cycles = 131072 bne _loop1 ;256256 times (255*256 times succeeds); 2 cycles (+1 if branch succeeds) = 196352 ldx #255 ;256 times ; 2 cycles = 512 dey ;256 times ; 2 cycles = 512 bne _loop1 ;255 times succeeds ; 2 cycles (+1 if branch succeeds) = 768 ply ; => 329216 cycles wasted \o/ this took ~5.5 seconds cycles_per_second=cycles/seconds plx ; ~=> 59857 cycles per second rts '
bauen1(Game Moderator)
Aug. 29, 2016, 5:45 p.m.
@wait:
phx
phy
ldx #0
ldy #0
_loop1: dex ;256*256 times ; 2 cycles = 131072
bne _loop1 ;256*256 times (255*256 times succeeds); 2 cycles (+1 if branch succeeds) = 196352
ldx #255 ;256 times ; 2 cycles = 512
dey ;256 times ; 2 cycles = 512
bne _loop1 ;255 times succeeds ; 2 cycles (+1 if branch succeeds) = 768
ply ; => 329216 cycles wasted \o/ this took ~5.5 seconds cycles_per_second=cycles/seconds
plx ; ~=> 59857 cycles per second
rts
bauen1(Game Moderator)
Aug. 29, 2016, 5:46 p.m.
Last attempt:
@wait:
phx
phy
ldx #0
ldy #0
_loop1: dex ;256*256 times ; 2 cycles = 131072
bne _loop1 ;256*256 times (255*256 times succeeds); 2 cycles (+1 if branch succeeds) = 196352
ldx #255 ;256 times ; 2 cycles = 512
dey ;256 times ; 2 cycles = 512
bne _loop1 ;255 times succeeds ; 2 cycles (+1 if branch succeeds) = 768
ply ; => 329216 cycles wasted \o/ this took ~5.5 seconds cycles_per_second=cycles/seconds
plx ; ~=> 59857 cycles per second
rts
bauen1(Game Moderator)
Aug. 29, 2016, 5:47 p.m.
so this is weird
``` this forum markdown will remove single newlines
but leave double newlines (i think?)
in code blocks (```)
```
bauen1(Game Moderator)
Aug. 29, 2016, 5:47 p.m.
``` test1 test2
test3 ``` (btw please work :()
bauen1(Game Moderator)
Aug. 29, 2016, 5:47 p.m.
well ``` wtf
```
bauen1(Game Moderator)
Aug. 29, 2016, 5:48 p.m.
``` why can't i do code blocks anymore ??
```
bauen1(Game Moderator)
Aug. 29, 2016, 5:49 p.m.
test ``` test2 test3
test4 ```
1 2 >>
Page 1 of 2.