I have encountered some problem and hope someone could explain.
I use the debug version of Snes9x to log a game ( Falcom : popful mail )
These are the first twelve instructions after a reset
Code: Select all
$00/8001 18 CLC A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvMXdIzC HC:0198 VC:000 FC:00 I:00
$00/8002 FB XCE A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:EnvMXdIzc HC:0220 VC:000 FC:00 I:00
$00/8003 E2 14 SEP #$14 A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMXdIzC HC:0242 VC:000 FC:00 I:00
$00/8005 C2 28 REP #$28 A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envMXdIzC HC:0272 VC:000 FC:00 I:00
$00/8007 A9 FE 01 LDA #$01FE A:0000 X:0000 Y:0000 D:0000 DB:00 S:01FF P:envmXdIzC HC:0302 VC:000 FC:00 I:00
$00/800A 1B TCS A:01FE X:0000 Y:0000 D:0000 DB:00 S:01FF P:envmXdIzC HC:0334 VC:000 FC:00 I:00
$00/800B 4B PHK A:01FE X:0000 Y:0000 D:0000 DB:00 S:01FE P:envmXdIzC HC:0356 VC:000 FC:00 I:00
$00/800C AB PLB A:01FE X:0000 Y:0000 D:0000 DB:00 S:01FD P:envmXdIzC HC:0386 VC:000 FC:00 I:00
$00/800D A0 00 LDY #$00 A:01FE X:0000 Y:0000 D:0000 DB:00 S:01FE P:envmXdIZC HC:0422 VC:000 FC:00 I:00
$00/800F A2 01 LDX #$01 A:01FE X:0000 Y:0000 D:0000 DB:00 S:01FE P:envmXdIZC HC:0446 VC:000 FC:00 I:00
$00/8011 A9 00 42 LDA #$4200 A:01FE X:0001 Y:0000 D:0000 DB:00 S:01FE P:envmXdIzC HC:0470 VC:000 FC:00 I:00
$00/8014 5B TCD A:4200 X:0001 Y:0000 D:0000 DB:00 S:01FE P:envmXdIzC HC:0502 VC:000 FC:00 I:00
the first two instruction CLC, XCE each used ( 220-198 ) (242-220) = 22 clocks
referring to the 65816 documents, this two instruction takes 2 machine cycles
As the ROM is $00/8000 range, reading this ROM opcode used 8 ( 21MHz clock) clocks, however the execution cycle will be 22-8 = 14 ( this is not 6/8/12 as mentioned in the documents, why is this so ? )
Furthermore, referring to the $00/800D 3 instructions LDY, LDX, LDA each takes 3, 3, 4 cycles ( index is 8 bit, M is 16 bit, so ACC fetches 2 bytes )
referring to HC they are ( 446-422 ), ( 470-446), ( 502-470 ) = 24, 24, 32 clock count.
This is correct for 3, 3, 4 CPU cycles each taking 8 clocks.
Can anyone tell me how the actual clock counts work ?