Skip to content

Plug In: Cycle Counter

Chysn edited this page Nov 15, 2023 · 3 revisions

Cycle Counter shows how many processor cycles were executed during a subroutine.

Installation
.P "CY"

Usage
.U addr

where addr is a valid 16-bit hexadecimal address.

Cycle Counter will count the number of cycles in the routine at the specified address by running the routine. The count does not include the RTS at the end of the routine. Routines assessed with Cycle Counter should end in RTS. After 65535 cycles, the count rolls back to 0. When executed in direct mode, Cycle Counter will print the number of cycles on the screen as a decimal number. When the plug-in is invoked in a program, the number of cycles is stored in the numeric UU variable, instead of being printed to the screen.

Example

.A 1800 LDY #100
.A 1802 @@ DEY
.A 1803 BNE @@
.A 1805 RTS
.P "CY"
.U 1800
501
Clone this wiki locally