Fixed cycle delay: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Gotta have more data)
(update)
Line 12: Line 12:
* Alternatively, @rts15 means you know a memory address that contains a harmless 3-cycle instruction that fits your constraints (such as <code>LDA $00</code>), followed by <code>RTS</code>.
* Alternatively, @rts15 means you know a memory address that contains a harmless 3-cycle instruction that fits your constraints (such as <code>LDA $00</code>), followed by <code>RTS</code>.
* @A, @X, @Y are local labels.
* @A, @X, @Y are local labels.


=== 2 cycles ===
=== 2 cycles ===
Line 670: Line 672:
!colspan="2"|6 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TSX
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PLA
LDX #4
TXS
@X:
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N; and requires @rts15
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #4
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
Line 723: Line 732:
PLA
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #4
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #4
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
Line 731: Line 752:
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TSX
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PLA
LDX #3
PLA
@X:
PLA
NOP
PLA
DEX
PLA
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
TXS</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #3
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 969: Line 996:
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #3
@X:
PHA
PHA
PHP
DEX
PLP
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #3
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
PLP
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
BIT $00
BIT $00
PLP
PLP
Line 995: Line 1,036:
TXS
TXS
PLA</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 1,061: Line 1,110:
!colspan="2"|6 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
LDX #5
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
@X:
@X:
PLA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #5
@Y:
@Y:
PLA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
!colspan="2"|7 bytes
!colspan="2"|7 bytes
Line 1,287: Line 1,336:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts15
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #5
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #5
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
NOP
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
LDY #5
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDX #5
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
!colspan="2"|8 bytes
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #4
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #4
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #5
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
Line 1,309: Line 1,407:
PLA
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
Line 1,337: Line 1,426:
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
Line 1,342: Line 1,436:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
!colspan="2"|7 bytes
Line 1,406: Line 1,495:
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts14
PHP
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14, and support for unofficial opcodes
LDY #4
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #4
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14, and support for unofficial opcodes
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TSX
PHP
PLA
LDX #3
PLA
@X:
PLA
NOP
PLA
DEX
PLA
BNE @X
TXS
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #3
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
Line 1,478: Line 1,591:
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #4
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #4
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
Line 1,485: Line 1,612:
!colspan="2"|8 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TSX
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #3
NOP
NOP
LDY #5
@Y:
@Y:
PLA
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
TXS</nowiki></pre> || style="padding:2px" | Clobbers A, X, Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
LDX #5
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
Line 1,562: Line 1,697:
!colspan="2"|6 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #6
@Y:
@Y:
PHA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #6
@X:
@X:
PHA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #5
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 1,582: Line 1,724:
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #5
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
Line 1,697: Line 1,832:
=== 34 cycles ===
=== 34 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts15
LDX #6
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #6
@Y:
@Y:
PHA
PHA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDX #6
@X:
@X:
PHA
PHA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
|-
LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
DEY
JSR @rts15
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDX #6
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDY #6
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDX #6
@X:
@X:
NOP
NOP
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDY #6
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #6
@Y:
@Y:
NOP
NOP
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
PHA
LDX #6
JSR @rts14
@X:
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
|-
!colspan="2"|9 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
NOP
JSR @rts15
JSR @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDY #6
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDX #6
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
Line 1,768: Line 1,947:
PLA
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDX #4
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDY #4
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
Line 1,786: Line 1,983:
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
PHA
LDY #4
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 1,850: Line 2,067:
=== 35 cycles ===
=== 35 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #6
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #6
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDX #6
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDY #6
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #5
@Y:
@Y:
JSR @rts12
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts12
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #5
@X:
@X:
JSR @rts12
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts12
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #6
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 1,874: Line 2,132:
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
!colspan="2"|9 bytes
@X:
PLA
PLA
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
@Y:
PLA
PLA
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #4
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #5
LDA #5
Line 1,906: Line 2,141:
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
@X:
ROL $00,X
ROR $00,X
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
@Y:
ROL $00,X
ROR $00,X
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
Line 2,001: Line 2,222:
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #6
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
Line 2,018: Line 2,246:
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDA #6
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
Line 2,034: Line 2,269:
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
PHP
PLP
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|10 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #3
@A:
NOP
NOP
NOP
NOP
NOP
NOP
SBC #1
JSR @rts14
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
NOP
PHA
NOP
SEC
NOP
LDA #130
JSR @rts14
@A = * - 1
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|11 bytes
!colspan="2"|11 bytes
Line 2,099: Line 2,337:
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}
Line 2,141: Line 2,394:
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDA #6
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
Line 2,154: Line 2,414:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHP
PLP
LDX #5
JSR @rts14
@X:
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #5
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHP
PHP
PLP
PLP
JSR @rts12
JSR @rts14
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
SEC
LDA #130
LDA #5
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
SBC #1
SBC #1
BMI @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
SEC
LDA #130
LDA #5
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
SBC #1
SBC #1
BMI @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
PLP
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
|-
|-
!colspan="2"|11 bytes
!colspan="2"|11 bytes
Line 2,209: Line 2,483:
=== 38 cycles ===
=== 38 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #6
LDY #7
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #7
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #6
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #6
LDX #6
@X:
@X:
Line 2,325: Line 2,613:
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @zptemp, and support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Requires @zptemp, and support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
BIT $00
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}
Line 2,331: Line 2,633:
=== 39 cycles ===
=== 39 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|8 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@Y:
LDX #7
JSR @rts14
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
@X:
@X:
JSR @rts14
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts14
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #7
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
!colspan="2"|7 bytes
PHP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDY #7
@Y:
@Y:
PHP
PLP
PHP
PLP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDX #7
@X:
@X:
PHP
PLP
PHP
PLP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDA #3
LDY #7
@A:
@Y:
PHP
DEY
PLP
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
PLA
LDX #7
PLA
@X:
JSR @rts14
DEX
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts14
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
|-
LDY #7
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TSX
LDY #3
@Y:
@Y:
PLA
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
TXS
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
NOP
LDX #7
PHP
@X:
PLP
DEX
JSR @rts14
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
JSR @rts12
LDX #7
JSR @rts12
@X:
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #7
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
!colspan="2"|8 bytes
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDX #7
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
TYA
LDY #7
PHA
LDY #4
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA
|-
TAY
!colspan="2"|9 bytes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHP
PHA
LDY #4
LDY #4
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts12
PHP
JSR @rts12
LDX #4
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts12
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts12
PLA
JSR @rts12
PLA
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12, and support for unofficial opcodes
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts14
|-
|-
|}
!colspan="2"|10 bytes
 
 
=== 40 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
PHA
LDY #5
@Y:
@Y:
DEY
BNE @Y
PLA
PLA
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
LDX #5
@X:
@X:
PLA
PLA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
NOP
PHP
LDY #5
@Y:
@Y:
TSX
PLA
TXS
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, X, Y, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
NOP
PHP
PLP
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
PHA
PHA
LDY #4
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
NOP
NOP
PHA
PHP
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #6
LDA #5
@A:
@A:
SBC #1
SBC #1
Line 2,511: Line 2,818:
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
@Y:
JSR @rts12
NOP
JSR @rts12
NOP
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts12
NOP
|-
NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
DEY
JSR @rts12
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12, and support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
NOP
NOP
NOP
NOP
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHP
PLP
PLP
JSR @rts15
PHP
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
PLP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>ROL $00,X
ROR $00,X
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHP
PHP
PLP
PLP
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHP
BIT $00
PLP
PLP
JSR @rts14
PHP
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
|}
PHA
 
SEC
 
LDA #130
=== 40 cycles ===
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|}
 
 
=== 41 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #7
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #7
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
NOP
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts12, @rts14, and @rts15
LDY #7
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PLA
NOP
PLA
LDX #7
JSR @rts15
@X:
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHP
PLP
LDY #6
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #3
@Y:
@Y:
NOP
NOP
NOP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #3
PHP
LDX #6
@X:
@X:
NOP
NOP
NOP
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #2
SEC
LDA #7
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #6
@A:
@A:
JSR @rts14
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @rts14
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
PHP
LDA #6
PLP
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
PHP
PHP
PLP
PLP
SBC #1
JSR @rts15
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
!colspan="2"|11 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA #2
BIT $00
@A:
PHP
PLP
PLP
PHP
JSR @rts15
PLP
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
SBC #1
|-
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>ROL $00,X
ROR $00,X
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHA
NOP
PHP
PHP
PLP
PLP
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
NOP
JSR @rts12
JSR @rts12
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PHP
BIT $00
PLP
PLP
SBC #1
JSR @rts14
BMI @A
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 2,747: Line 2,972:
@A = * - 1
@A = * - 1
; ^ Hides !NOP #imm
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
SBC #1
SBC #1
BMI @A
BMI @A
Line 2,754: Line 2,978:
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|-
|}
!colspan="2"|12 bytes
 
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
PHP
PLP
PHP
PLP
PHP
ROL $00,X
ROR $00,X
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 


=== 42 cycles ===
=== 41 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|9 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
JSR @rts15
@X:
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts15
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
PHA
LDY #6
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
!colspan="2"|8 bytes
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|-
PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>ROL $00,X
LDX #6
ROR $00,X
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #2
@X:
@X:
JSR @rts12
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X; and requires @rts12
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #2
PHP
LDY #6
@Y:
@Y:
JSR @rts12
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y; and requires @rts12
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
PHP
LDA #7
PLP
@A:
JSR @rts15
SBC #1
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
BIT $00
SEC
LDY #6
LDA #5
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 43 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
@Y:
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #7
BIT $00
LDX #6
@X:
@X:
DEX
DEX
Line 2,848: Line 3,051:
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDY #7
SEC
@Y:
LDA #7
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #8
@A:
@A:
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts12, @rts14, and @rts15
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts12
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12, and @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PLA
PLA
PLA
PLA
PLA
JSR @rts15
JSR @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts14
|-
|-
!colspan="2"|11 bytes
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
NOP
PHP
PHP
Line 2,904: Line 3,077:
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
PLA
TYA
PLA
PHA
PLA
LDY #5
PLA
@Y:
DEY
BNE @Y
PLA
PLA
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA
PLA
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
PHA
PHP
PHP
Line 2,924: Line 3,094:
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|11 bytes
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
PHP
PLP
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
NOP
LDA #130
TYA
@A = * - 1
PHA
; ^ Hides !NOP #imm
LDY #5
NOP $EA44 ;hides 'NOP zp'
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
PHP
PLP
PLP
SBC #1
JSR @rts14
BMI @A
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
SEC
LDA #3
LDA #4
@A:
@A:
NOP
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
SEC
LDA #3
LDA #4
@A:
@A:
NOP
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
SEC
PHA
LDA #130
LDY #2
@A = * - 1
@Y:
; ^ Hides !NOP #imm
PHP
NOP $EA ;hides 'NOP'
PLP
PHP
DEY
PLP
BNE @Y
SBC #1
PLA
BMI @A
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
|}
!colspan="2"|12 bytes
 
 
=== 44 cycles ===
{| class="wikitable"
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #3
PLP
@X:
PHP
PHP
BIT $00
PLP
PLP
DEX
JSR @rts12
BNE @X
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #3
PHA
TYA
PHA
LDY #4
@Y:
@Y:
PHP
PLP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts15
NOP
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
NOP
PHP
SEC
LDA #5
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|-
PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHP
PLP
PHP
PLP
PLP
PHP
PHP
PLP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
PHP
PHP
PLP
PLP
SBC #1
PHP
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
Line 3,073: Line 3,217:
@A = * - 1
@A = * - 1
; ^ Hides !NOP #imm
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP $EAEA ;hides two 'NOP's
NOP
NOP
SBC #1
SBC #1
Line 3,080: Line 3,224:
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|-
|}
!colspan="2"|13 bytes
 
 
=== 45 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 42 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
LDX #7
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
LDY #7
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
@X:
PHA
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
!colspan="2"|8 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
NOP
NOP
NOP
NOP
LDX #7
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
@X:
@X:
NOP
NOP
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #6
NOP
@A:
NOP
NOP
SBC #1
LDY #7
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDA #7
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts15
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDX #6
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #6
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>ROL $00,X
ROR $00,X
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
SEC
LDA #7
LDA #6
@A:
@A:
SBC #1
SBC #1
Line 3,140: Line 3,339:
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
SEC
LDA #7
LDA #6
@A:
@A:
SBC #1
SBC #1
Line 3,148: Line 3,348:
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
JSR @rts14
PLP
JSR @rts14
JSR @rts15
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
!colspan="2"|11 bytes
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
JSR @rts12
JSR @rts12
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and V; and requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14, and support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #4
LDA #5
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
Line 3,194: Line 3,370:




=== 46 cycles ===
=== 43 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
@Y:
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #7
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #2
LDY #7
@Y:
@Y:
JSR @rts14
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDX #2
LDA #8
@X:
@A:
JSR @rts14
SBC #1
DEX
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X; and requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
!colspan="2"|9 bytes
PLA
PLA
PLA
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
!colspan="2"|10 bytes
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
JSR @rts12
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @rts12, and support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
PHA
PHA
PHP
PHP
PLP
PLP
SBC #1
JSR @rts15
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires support for unofficial opcodes
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PLP
PHP
PHP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #3
LDA #6
@A:
@A:
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts12
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12, and @rts14
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #2
@Y:
PHP
PLP
PLP
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
PHP
PLP
PLP
DEY
JSR @rts15
BNE @Y
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #2
LDA $00
@X:
SEC
PHP
LDA #6
PLP
@A:
PHP
SBC #1
PLP
BNE @A
DEX
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
SEC
LDA #3
LDA #6
@A:
@A:
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
Line 3,316: Line 3,481:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHA
PHA
PHP
PLP
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
!colspan="2"|13 bytes
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
NOP
PHP
PLP
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
PHA
TYA
SEC
PHA
LDA #130
LDY #4
@A = * - 1
@Y:
; ^ Hides !NOP #imm
DEY
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
BNE @Y
SBC #1
PLA
BMI @A
TAY
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers S; and requires support for unofficial opcodes
|-
|-
|}
!colspan="2"|13 bytes
 
 
=== 47 cycles ===
{| class="wikitable"
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
PHA
LDY #7
LDY #2
@Y:
@Y:
PHP
PLP
DEY
DEY
BNE @Y
BNE @Y
PLA
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
PHA
PHA
JSR @rts15
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N; and requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
@X:
PHA
PHA
JSR @rts15
PHP
DEX
PLP
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N; and requires @rts15
PHP
|-
PLP
!colspan="2"|10 bytes
PHP
PLP
PHP
PLP
PHP
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
JSR @rts15
PLP
JSR @rts15
PHP
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
PHA
|-
SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #130
LDY #3
@A = * - 1
@Y:
; ^ Hides !NOP #imm
TSX
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLA
PLA
TXS
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
DEY
BNE @Y
PLA</nowiki></pre> || style="padding:2px" | Clobbers X, Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|14 bytes
LDY #3
@Y:
TSX
PLA
TXS
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
NOP
NOP
JSR @rts14
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
@X:
NOP
NOP
NOP
NOP
JSR @rts14
PHP
DEX
PLP
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts14
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #2
|}
 
 
=== 44 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #8
@Y:
@Y:
PHA
PHA
JSR @rts12
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N; and requires @rts12
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #2
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #8
@X:
@X:
PHA
PHA
JSR @rts12
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N; and requires @rts12
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
PHA
LDY #8
SEC
@Y:
LDA #6
DEY
@A:
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
 
LDX #8
 
@X:
=== 48 cycles ===
DEX
{| class="wikitable"
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDY #8
LDY #8
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDX #8
LDX #8
@X:
@X:
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDA #9
LDY #8
@A:
@Y:
SBC #1
DEY
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDX #8
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #8
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDX #8
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDY #8
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDX #8
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
!colspan="2"|9 bytes
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #3
@Y:
PHP
PLP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDX #3
LDX #3
@X:
@X:
Line 3,481: Line 3,673:
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and V; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PLA
JSR @rts14
SEC
JSR @rts15
LDA #7
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
PHP
PLP
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
PHA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
!colspan="2"|11 bytes
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15, and support for unofficial opcodes
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
SEC
SEC
LDA #2
LDA #6
@A:
@A:
JSR @rts14
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
SEC
LDA #2
LDA #5
@A:
@A:
JSR @rts14
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @rts14
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 45 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDY #8
LDA #130
@Y:
@A = * - 1
DEY
; ^ Hides !NOP #imm
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
NOP $EAEA ;hides two 'NOP's
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #8
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #6
@Y:
NOP
NOP
PHP
DEY
PLP
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDX #6
LDA #130
@X:
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
NOP
PHP
DEX
PLP
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|13 bytes
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #7
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #6
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #2
LDA #7
@A:
@A:
PHP
PLP
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
Line 3,573: Line 3,823:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #2
LDA #7
@A:
@A:
PHP
PLP
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
PLP
SBC #1
JSR @rts12
BMI @A
JSR @rts12
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and V; and requires @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts14
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14, and support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}




=== 49 cycles ===
=== 46 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
@X:
PHA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
@Y:
@Y:
PHP
PLP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #7
@X:
@X:
PHP
PLP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #8
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
JSR @rts15
BIT $00
JSR @rts15
LDX #7
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA #130
BIT $00
@A = * - 1
LDY #7
; ^ Hides !NOP #imm
@Y:
NOP $EA,X ;hides 'NOP'
DEY
JSR @rts14
BNE @Y
SBC #1
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @rts14, and support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDA #130
SEC
@A = * - 1
LDA #8
; ^ Hides !NOP #imm
@A:
NOP $4848 ;hides two 'PHA's
JSR @rts12
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires @rts12, and support for unofficial opcodes
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
JSR @rts14
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
TYA
TYA
PHA
PHA
Line 3,673: Line 3,954:
BNE @Y
BNE @Y
PLA
PLA
TAY
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PLP
PHP
PLP
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
TYA
TYA
PHA
PHA
LDY #6
LDY #5
@Y:
@Y:
DEY
DEY
Line 3,685: Line 4,004:
PLA
PLA
TAY
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PLP
PLP
JSR @rts14
JSR @rts12
JSR @rts14
JSR @rts12
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
JSR @rts12</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts12
|-
|-
|}
!colspan="2"|13 bytes
 
 
=== 50 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #7
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 47 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
LDX #8
@X:
@X:
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #7
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
LDY #8
@Y:
@Y:
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
!colspan="2"|8 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #6
@Y:
NOP
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #6
LDX #6
@X:
@X:
NOP
NOP
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDY #6
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
SEC
LDA #8
LDA #8
@A:
@A:
SBC #1
SBC #1
BNE @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
SEC
PHA
LDA #8
LDY #7
@A:
@Y:
SBC #1
DEY
BNE @A
BNE @Y
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDX #7
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|10 bytes
PLP
JSR @rts14
JSR @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
!colspan="2"|13 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHA
SEC
SEC
LDA #130
LDA #7
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
PHP
PLP
SBC #1
SBC #1
BMI @A
BNE @A
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|-
!colspan="2"|11 bytes
!colspan="2"|14 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #3
LDA #6
@A:
@A:
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
Line 3,796: Line 4,142:




=== 51 cycles ===
=== 48 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #9
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #10
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #9
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #10
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #8
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #8
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #6
LDA #9
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #4
@A:
@A:
PHP
PLP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
JSR @rts14
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|-
PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #130
LDA #7
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
PHP
PLP
SBC #1
SBC #1
BMI @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
SEC
LDA #130
LDA #7
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
NOP
PHP
PLP
SBC #1
SBC #1
BMI @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDA $00
TYA
SEC
PHA
LDA #7
LDY #5
@A:
@Y:
SBC #1
DEY
BNE @A
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA
|-
TAY
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PLA
LDA $00
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
 
JSR @rts15
 
JSR @rts15
=== 52 cycles ===
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and V; and requires @rts15
{| class="wikitable"
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
NOP
JSR @rts12
JSR @rts14
DEX
JSR @rts15
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts12
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
@Y:
JSR @rts15
JSR @rts12
JSR @rts15
DEY
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts15
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #7
PHA
@A:
JSR @rts14
NOP
JSR @rts14
SBC #1
JSR @rts14</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts14
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
@X:
JSR @rts15
PLA
JSR @rts15
PLA
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15, and support for unofficial opcodes
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
!colspan="2"|12 bytes
@Y:
PLA
PLA
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
JSR @rts12
JSR @rts12
JSR @rts12</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHA
TYA
PHA
PHA
LDY #8
LDY #5
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y
PLA
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@X:
PHP
ROL $00,X
PHA
ROR $00,X
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
@Y:
ROL $00,X
ROR $00,X
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #6
LDA #4
@A:
@A:
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #4
PHA
@Y:
SEC
NOP
LDA #130
NOP
@A = * - 1
NOP
; ^ Hides !NOP #imm
DEY
NOP $EA ;hides 'NOP'
BNE @Y
PHP
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|14 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #4
@X:
NOP
NOP
NOP
NOP
NOP
PHP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #7
LDA #5
@A:
@A:
SBC #1
SBC #1
Line 4,008: Line 4,330:




=== 53 cycles ===
=== 49 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
LDX #9
@X:
@X:
PHA
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
LDY #9
@Y:
@Y:
PHP
PLP
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
LDA #10
@X:
@A:
PHP
SBC #1
PLP
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PLA
PHA
JSR @rts15
PHP
JSR @rts15
LDX #7
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N; and requires @rts15
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PLA
SEC
SEC
LDA #130
LDA #8
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
JSR @rts12
SBC #1
SBC #1
BMI @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @rts12, and support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
!colspan="2"|10 bytes
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
JSR @rts12
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @rts12, and support for unofficial opcodes
|-
|-
!colspan="2"|13 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
LDY #7
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 54 cycles ===
{| class="wikitable"
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #6
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
Line 4,095: Line 4,402:
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
NOP
TYA
PHP
PHA
LDY #7
LDY #7
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
TAY
|-
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
LDX #7
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
TYA
PHA
PHA
LDY #7
LDY #6
@Y:
@Y:
DEY
DEY
Line 4,117: Line 4,439:
PLA
PLA
TAY
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
!colspan="2"|12 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
PHA
LDY #3
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 50 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #7
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #7
@Y:
@Y:
TSX
NOP
PLA
TXS
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and Y
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #2
LDX #6
@X:
@X:
NOP
NOP
NOP
JSR @rts14
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #2
LDY #6
@Y:
@Y:
NOP
NOP
NOP
JSR @rts14
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
 
SEC
 
LDA #9
=== 55 cycles ===
@A:
{| class="wikitable"
SBC #1
!colspan="2"|6 bytes
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
NOP
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
NOP
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>CLC
LDA #250
@A = * - 1
; ^ Hides !NOP
NOP
ADC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
Line 4,202: Line 4,518:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #9
LDA #8
@A:
@A:
SBC #1
SBC #1
Line 4,210: Line 4,526:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #9
LDA #8
@A:
@A:
SBC #1
SBC #1
Line 4,216: Line 4,532:
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
PLP
JSR @rts14
JSR @rts14
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
PLP</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TXA
BIT $00
PHA
JSR @rts15
LDX #3
JSR @rts15
@X:
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and V; and requires @rts15
PHP
|-
PLP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
DEX
JSR @rts12
BNE @X
JSR @rts12
PLA
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts12, and @rts14
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
!colspan="2"|14 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
STA @zptemp
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @zptemp, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
PHA
SEC
SEC
LDA #2
LDA #6
@A:
@A:
JSR @rts14
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
NOP $00
SEC
JSR @rts15
LDA #130
JSR @rts15
@A = * - 1
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15, and support for unofficial opcodes
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
PHP
PLP
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|-
!colspan="2"|15 bytes
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
LDA $00
SEC
SEC
LDA #2
LDA #6
@A:
@A:
PHP
PLP
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
Line 4,285: Line 4,598:




=== 56 cycles ===
=== 51 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #10
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #10
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #8
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #8
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #6
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #4
BIT $00
LDY #8
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDX #8
@X:
@X:
PHP
PLP
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDY #4
LDA #4
@Y:
@A:
PHP
PHP
PLP
PLP
DEY
SBC #1
BNE @Y
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
!colspan="2"|10 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDA #130
TYA
@A = * - 1
PHA
; ^ Hides !NOP #imm
LDY #7
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
@Y:
JSR @rts15
DEY
SBC #1
BNE @Y
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @rts15, and support for unofficial opcodes
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
NOP
NOP
JSR @rts14
TYA
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @zptemp, @rts14, and support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
PHA
PHA
JSR @rts12
LDY #7
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires @rts12, and support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $48,X ;hides 'PHA'
PHA
JSR @rts14
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires @rts14, and support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #4
@Y:
@Y:
NOP
NOP
NOP
DEY
DEY
BNE @Y
BNE @Y
Line 4,377: Line 4,689:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
PLP
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
JSR @rts14
JSR @rts14
SBC #1
JSR @rts15
BMI @A
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @rts14, and support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
SEC
SEC
LDA #130
LDA #7
@A = * - 1
@A:
; ^ Hides !NOP #imm
SBC #1
NOP $EA,X ;hides 'NOP'
BNE @A
JSR @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
SEC
LDA #7
@A:
SBC #1
SBC #1
BMI @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @rts14, and support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
|-
!colspan="2"|13 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHA
TYA
TYA
Line 4,410: Line 4,739:
PLA
PLA
TAY
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PLP
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
Line 4,416: Line 4,776:




=== 57 cycles ===
=== 52 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #7
@Y:
@Y:
NOP
NOP
Line 4,426: Line 4,787:
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #7
@X:
@X:
NOP
NOP
Line 4,432: Line 4,794:
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #136
LDA #7
@A = * - 1
@A:
; ^ Hides DEY
NOP
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #8
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #7
PHP
LDY #6
@Y:
@Y:
NOP
NOP
Line 4,451: Line 4,823:
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #7
PHP
LDX #6
@X:
@X:
NOP
NOP
Line 4,459: Line 4,832:
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|9 bytes
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #9
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #8
LDA #6
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}




=== 58 cycles ===
=== 53 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #10
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #10
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #10
LDX #9
@X:
@X:
DEX
DEX
Line 4,497: Line 4,893:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #10
LDY #9
@Y:
@Y:
DEY
DEY
Line 4,504: Line 4,900:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #11
LDA #10
@A:
@A:
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
SEC
LDA #4
LDA #8
@A:
@A:
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
SEC
LDA #4
LDA #8
@A:
@A:
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|14 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDA $00
SEC
LDA #8
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
SEC
LDA #130
LDA #8
@A = * - 1
@A:
; ^ Hides !NOP #imm
SBC #1
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
BNE @A
NOP
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHP
PLP
PLP
SBC #1
JSR @rts14
BMI @A
JSR @rts15
PLA
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHA
JSR @rts15
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Clobbers S; and requires @rts15
|-
|-
!colspan="2"|15 bytes
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
PHA
LDY #3
SEC
@Y:
LDA #3
NOP
@A:
NOP
PHP
NOP
PLP
NOP
SBC #1
DEY
BNE @A
BNE @Y
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
|}
|}




=== 59 cycles ===
=== 54 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|8 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #10
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TSX
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #6
LDY #10
@Y:
@Y:
PLA
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
TXS</nowiki></pre> || style="padding:2px" | Clobbers A, X, Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
!colspan="2"|7 bytes
LDA #8
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDX #10
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDY #10
LDA #7
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #3
@Y:
@Y:
JSR @rts12
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y; and requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDX #3
LDX #10
@X:
@X:
JSR @rts12
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
PLP</nowiki></pre> || style="padding:2px" | Clobbers X; and requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
SEC
LDY #10
LDA #7
@Y:
@A:
DEY
NOP
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
SBC #1
|-
BNE @A
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
LDX #10
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDY #10
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDX #10
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
TYA
LDY #10
PHA
LDY #8
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
PLA
|-
TAY
!colspan="2"|8 bytes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDY #3
LDY #10
@Y:
@Y:
ROL $00,X
ROR $00,X
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDX #3
LDX #10
@X:
@X:
ROL $00,X
ROR $00,X
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|12 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
SEC
LDA #6
LDA #7
@A:
@A:
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 60 cycles ===
{| class="wikitable"
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #10
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|14 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
PHP
LDA #130
LDY #8
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
JSR @rts12
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @rts12, and support for unofficial opcodes
|-
|}
 
 
=== 61 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #12
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #12
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDX #8
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
!colspan="2"|8 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>CLC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
LDA #250
@A = * - 1
; ^ Hides !NOP
PHA
PHA
ADC #1
LDY #6
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires support for unofficial opcodes
@Y:
NOP
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>CLC
PHP
LDA #250
LDX #6
@A = * - 1
; ^ Hides !NOP
NOP $00
ADC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
PHA
LDX #7
@X:
@X:
NOP
NOP
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #6
@Y:
NOP
NOP
DEY
PHP
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
LDY #6
LDY #6
@Y:
@Y:
Line 4,776: Line 5,116:
DEY
DEY
BNE @Y
BNE @Y
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
!colspan="2"|13 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
TYA
TYA
PHA
PHA
Line 4,792: Line 5,129:
PLA
PLA
TAY
TAY
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
 
PHP
 
SEC
=== 62 cycles ===
LDA #6
{| class="wikitable"
@A:
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #10
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #6
@X:
NOP
NOP
NOP
SBC #1
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #6
@Y:
NOP
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
CLC
LDA #250
@A = * - 1
; ^ Hides !NOP
NOP
ADC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
!colspan="2"|12 bytes
CLC
LDA #250
@A = * - 1
; ^ Hides !NOP
NOP
ADC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #9
LDA #7
@A:
@A:
SBC #1
SBC #1
Line 4,866: Line 5,157:




=== 63 cycles ===
=== 55 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
LDY #11
@Y:
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
NOP
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
NOP
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #9
@Y:
@Y:
DEY
DEY
Line 4,877: Line 5,199:
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #11
PHP
LDX #9
@X:
@X:
DEX
DEX
Line 4,884: Line 5,207:
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #12
SEC
LDA #10
@A:
@A:
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|12 bytes
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #3
@Y:
JSR @rts12
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N; and requires @rts12
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #130
LDA #9
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
JSR @rts15
SBC #1
SBC #1
BMI @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @rts15, and support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #130
LDA #9
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
JSR @rts15
SBC #1
SBC #1
BMI @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @rts15, and support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts12
PHA
JSR @rts14
LDY #3
@Y:
ROL $00,X
ROR $00,X
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
NOP
JSR @rts14
JSR @rts14
SBC #1
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts12, @rts14, and @rts15
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @zptemp, @rts14, and support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
SEC
LDA #130
LDA #7
@A = * - 1
@A:
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
NOP
JSR @rts14
SBC #1
SBC #1
BMI @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @zptemp, @rts14, and support for unofficial opcodes
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
!colspan="2"|14 bytes
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
PHA
LDY #4
LDA $00
@Y:
SEC
NOP
LDA #7
NOP
@A:
NOP
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
LDY #4
@Y:
NOP
NOP
NOP
DEY
BNE @Y
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
JSR @rts14
SBC #1
SBC #1
BMI @A
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @rts14, and support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}




=== 64 cycles ===
=== 56 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
@X:
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #9
@Y:
@Y:
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #8
PHP
@X:
LDX #9
NOP
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #10
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #4
@X:
PHP
PLP
DEX
DEX
BNE @X
BNE @X
Line 5,034: Line 5,317:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #8
LDY #4
@Y:
@Y:
NOP
PHP
PLP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #136
LDA #10
@A = * - 1
@A:
; ^ Hides DEY
SBC #1
SBC #1
BMI @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
TYA
LDA #136
PHA
@A = * - 1
LDY #8
; ^ Hides DEY
@Y:
SBC #1
DEY
BMI @A
BNE @Y
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
TYA
PHA
PHA
LDY #9
LDY #6
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
PLA
PLA
TAY
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
 
PHA
 
PHP
=== 65 cycles ===
SEC
{| class="wikitable"
LDA #8
!colspan="2"|6 bytes
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@X:
PHA
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
PHA
PHA
DEY
SEC
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
LDA #8
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|7 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
PHA
LDA $00
TYA
DEX
PHA
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
LDY #7
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
@Y:
LDA $00
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
NOP
BIT $00
PHP
DEX
SEC
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
LDA #6
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
@Y:
JSR @rts14
BIT $00
JSR @rts14
DEY
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
!colspan="2"|13 bytes
@X:
STA @zptemp
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
STA @zptemp
PHP
DEY
PHA
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
|}
@X:
 
NOP $00
 
DEX
=== 57 cycles ===
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
{| class="wikitable"
|-
!colspan="2"|6 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
NOP $00
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
@X:
@X:
JMP *+3
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
Line 5,153: Line 5,436:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
@Y:
JMP *+3
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #136
@A = * - 1
; ^ Hides DEY
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #7
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #7
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #9
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
SEC
LDA #11
LDA #9
@A:
@A:
SBC #1
SBC #1
Line 5,167: Line 5,489:
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
SEC
LDA #11
LDA #9
@A:
@A:
SBC #1
SBC #1
Line 5,175: Line 5,498:
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #4
LDA #8
@A:
@A:
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
Line 5,192: Line 5,513:




=== 66 cycles ===
=== 58 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #13
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #11
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #13
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #11
@Y:
@Y:
DEY
DEY
Line 5,208: Line 5,531:
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA #137
LDY #10
@A = * - 1
@Y:
; ^ Hides !NOP #imm
DEY
NOP
BNE @Y
SBC #1
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #10
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #9
LDA #11
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
Line 5,227: Line 5,553:
!colspan="2"|10 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
SEC
LDA #8
LDA #9
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
SEC
LDA #8
LDA #9
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|12 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #7
LDA #4
@A:
@A:
NOP
PHP
PLP
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
 
SEC
 
LDA #4
=== 67 cycles ===
@A:
{| class="wikitable"
PHP
!colspan="2"|7 bytes
PLP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts14
JSR @rts14
JSR @rts15
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts14, and @rts15
|-
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
PHA
PHA
TYA
PHA
PHA
LDY #7
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@X:
PHA
PHA
PHP
PHA
PHA
DEX
SEC
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
!colspan="2"|8 bytes
!colspan="2"|14 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
NOP
NOP
NOP
NOP
NOP
PHP
DEX
PHA
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
|}
 
 
=== 59 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #11
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #11
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #8
@Y:
@Y:
NOP
NOP
NOP
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #8
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #8
LDA #8
@A:
@A:
PHA
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHP
LDX #11
LDY #7
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #7
@X:
@X:
NOP
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #10
LDA #7
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
 
SEC
 
LDA #7
=== 68 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #12
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #12
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #13
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
PHA
LDY #8
LDY #8
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
PLA
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
!colspan="2"|11 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
CLC
PHA
LDA #250
SEC
@A = * - 1
LDA #6
; ^ Hides !NOP
@A:
NOP $00
NOP
ADC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|}
CLC
 
LDA #250
 
@A = * - 1
=== 60 cycles ===
; ^ Hides !NOP
{| class="wikitable"
NOP $00
!colspan="2"|6 bytes
ADC #1
|-
BNE @A
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
LDX #11
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #11
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
!colspan="2"|12 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TXA
PHA
LDX #7
@X:
NOP
NOP
DEX
LDY #11
BNE @X
@Y:
PLA
DEY
TAX
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TXA
NOP
PHA
LDX #11
LDX #7
@X:
@X:
NOP
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLA
TAX
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
!colspan="2"|14 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHP
TYA
LDY #10
PHA
LDY #6
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
TAY
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
 
PHP
 
LDX #10
=== 69 cycles ===
{| class="wikitable"
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
@Y:
JSR @rts12
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
@X:
@X:
JSR @rts12
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts12
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TSX
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #8
SEC
@Y:
LDA #11
PHA
@A:
DEY
SBC #1
BNE @Y
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
TXS</nowiki></pre> || style="padding:2px" | Clobbers X, Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
@Y:
PLA
PLA
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
@X:
PLA
PLA
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
@Y:
SEC
ROL $00,X
LDA #10
ROR $00,X
@A:
DEY
SBC #1
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@X:
SEC
ROL $00,X
LDA #10
ROR $00,X
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #6
@A:
@A:
PHA
PHA
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JSR @rts15
LDA #6
JSR @rts15
@A:
JSR @rts15
NOP
JSR @rts15</nowiki></pre> || style="padding:2px" | Requires @rts15
NOP
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHP
PHA
PHA
LDY #10
SEC
@Y:
LDA #8
DEY
@A:
BNE @Y
SBC #1
BNE @A
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
PHA
LDY #10
LDA $00
@Y:
SEC
DEY
LDA #8
BNE @Y
@A:
SBC #1
BNE @A
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
CLC
LDA #250
@A = * - 1
; ^ Hides !NOP
NOP
ADC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|-
|}
|}




=== 70 cycles ===
=== 61 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|9 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #12
SEC
LDA #12
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
@Y:
@Y:
PHA
JSR @rts15
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N; and requires @rts15
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #12
@X:
@X:
PHA
JSR @rts15
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N; and requires @rts15
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #10
@Y:
@Y:
BIT $00
JSR @rts15
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V; and requires @rts15
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #10
@X:
@X:
BIT $00
JSR @rts15
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V; and requires @rts15
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #11
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDY #10
@Y:
@Y:
NOP
NOP
JSR @rts14
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts14
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDX #10
@X:
@X:
NOP
NOP
JSR @rts14
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts14
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
SEC
STA @zptemp
LDA #8
JSR @rts15
@A:
DEX
NOP
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp, and @rts15
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
!colspan="2"|10 bytes
@Y:
STA @zptemp
JSR @rts15
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp, and @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
@Y:
PHA
PHA
PHA
LDX #7
JSR @rts12
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N; and requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
@X:
@X:
PHA
NOP
PHA
JSR @rts12
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N; and requires @rts12
BNE @X
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
!colspan="2"|11 bytes
@Y:
NOP $00
JSR @rts15
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts15, and support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
PHP
NOP $00
SEC
JSR @rts15
LDA #7
DEX
@A:
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts15, and support for unofficial opcodes
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
@Y:
NOP
NOP
NOP
SBC #1
PHP
BNE @A
PLP
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PHP
PLP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
PHA
SEC
LDA #7
@A:
NOP
NOP
NOP
SBC #1
PHP
BNE @A
PLP
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PHP
PLP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|14 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
TYA
PHA
PHA
LDY #3
LDY #6
@Y:
@Y:
JSR @rts12
NOP
DEY
DEY
BNE @Y
BNE @Y
PLA
PLA
TAY
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts12
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
PHA
SEC
SEC
LDA #130
LDA #6
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
JSR @rts15
SBC #1
SBC #1
BMI @A
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @rts15, and support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
!colspan="2"|15 bytes
|}
 
 
=== 62 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
PHA
LDY #3
LDY #11
@Y:
@Y:
ROL $00,X
ROR $00,X
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
SEC
LDX #11
LDA #130
@X:
@A = * - 1
DEX
; ^ Hides !NOP #imm
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
NOP
JSR @rts14
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @zptemp, @rts14, and support for unofficial opcodes
|-
|-
!colspan="2"|16 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
NOP
TYA
PHA
LDY #4
@Y:
NOP
NOP
LDX #11
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
NOP
NOP
LDY #11
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA
|-
TAY
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
PLA
SEC
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
LDA #11
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
|}
!colspan="2"|9 bytes
 
 
=== 71 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
@Y:
PHA
DEY
LDX #10
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
@X:
DEX
BNE @X
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #6
@X:
@X:
NOP
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #9
LDY #6
@Y:
@Y:
NOP
NOP
NOP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #9
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|10 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #4
PHP
SEC
LDA #10
@A:
@A:
JSR @rts12
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @rts12
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #136
LDA #9
@A = * - 1
@A:
; ^ Hides DEY
SBC #1
SBC #1
BMI @A
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
Line 5,817: Line 6,107:




=== 72 cycles ===
=== 63 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|9 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #12
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
LDY #12
LDY #12
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|7 bytes
LDY #8
@Y:
BIT $00
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #8
LDX #11
@X:
@X:
BIT $00
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #11
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
PHA
LDA #12
SEC
LDA #11
@A:
@A:
SBC #1
SBC #1
BNE @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
!colspan="2"|10 bytes
 
 
=== 73 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@Y:
PHP
PHA
SEC
DEY
LDA #10
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@X:
PHA
PHA
DEX
SEC
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
LDA #10
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #13
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #13
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #14
@A:
@A:
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA $00
SEC
SEC
LDA #137
LDA #10
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP
SBC #1
SBC #1
BMI @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
SEC
LDA #137
LDA #10
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP
SBC #1
SBC #1
BMI @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
PHA
LDA #9
TYA
@A:
PHA
LDY #6
@Y:
NOP
NOP
SBC #1
DEY
BNE @A
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
PHA
SEC
SEC
LDA #9
LDA #8
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
!colspan="2"|12 bytes
!colspan="2"|14 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHA
PHA
SEC
SEC
LDA #8
LDA #6
@A:
@A:
NOP
NOP
Line 5,957: Line 6,230:




=== 74 cycles ===
=== 64 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|10 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
LDY #6
@Y:
@Y:
NOP
NOP
NOP
NOP
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
LDX #6
@X:
@X:
NOP
NOP
NOP
NOP
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|11 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TXA
LDY #8
PHA
@Y:
LDX #11
NOP
@X:
DEY
DEX
BNE @Y
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLA
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TXA
LDX #8
PHA
LDX #11
@X:
@X:
NOP
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
TAX
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|}
 
 
=== 75 cycles ===
{| class="wikitable"
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #9
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
Line 6,023: Line 6,268:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #13
LDA #136
@A:
@A = * - 1
; ^ Hides DEY
SBC #1
SBC #1
BNE @A
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #13
LDA #136
@A:
@A = * - 1
; ^ Hides DEY
SBC #1
SBC #1
BNE @A
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|12 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
TYA
PHA
PHA
LDY #8
LDY #9
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
Line 6,051: Line 6,297:
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
!colspan="2"|13 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
PHA
CLC
SEC
LDA #250
LDA #9
@A = * - 1
@A:
; ^ Hides !NOP
SBC #1
NOP $00
ADC #1
BNE @A
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|14 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
TXA
PHA
LDX #7
@X:
NOP
DEX
BNE @X
PLA
TAX
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
Line 6,084: Line 6,313:




=== 76 cycles ===
=== 65 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
@X:
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #15
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDY #12
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #15
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDX #12
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #4
PHP
@X:
LDY #11
JSR @rts12
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X; and requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #4
@Y:
@Y:
JSR @rts12
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y; and requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TSX
LDY #8
@Y:
PHA
DEY
BNE @Y
TXS
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and Y
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
PHA
LDX #8
@X:
LDA $00
DEX
BNE @X
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #4
@Y:
ROL $00,X
ROR $00,X
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #4
PHP
LDX #11
@X:
@X:
ROL $00,X
ROR $00,X
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #12
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #6
LDA #11
@A:
@A:
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
Line 6,171: Line 6,382:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #6
LDA #11
@A:
@A:
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
!colspan="2"|13 bytes
!colspan="2"|13 bytes
Line 6,184: Line 6,405:
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
TYA
SEC
PHA
LDA #4
LDY #10
@A:
@Y:
PHP
DEY
PLP
BNE @Y
SBC #1
PLA
BNE @A
TAY
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
Line 6,198: Line 6,418:




=== 77 cycles ===
=== 66 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|8 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TSX
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #13
LDY #9
@Y:
@Y:
PHA
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
TXS</nowiki></pre> || style="padding:2px" | Clobbers X, Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #13
@X:
@X:
JSR @rts14
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @rts14
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
!colspan="2"|7 bytes
@Y:
JSR @rts14
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @rts14
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
|-
LDA #137
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
@A = * - 1
PHA
; ^ Hides !NOP #imm
LDX #13
NOP
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #9
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #11
@X:
@X:
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #4
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
PHP
PHP
PLP
LDY #8
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHP
PLP
LDX #8
@X:
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #4
!colspan="2"|10 bytes
@Y:
PHP
PLP
PHP
PLP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #12
LDA #8
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #7
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
Line 6,266: Line 6,523:




=== 78 cycles ===
=== 67 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
PHA
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
@X:
NOP
PHA
PHA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
@Y:
NOP
NOP
NOP
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #14
@X:
@X:
NOP
NOP
NOP
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDY #14
LDA #8
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #11
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDX #11
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #11
@Y:
@Y:
DEY
DEY
Line 6,298: Line 6,595:
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
!colspan="2"|10 bytes
LDA #15
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #4
LDA #11
@A:
@A:
JSR @rts12
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @rts12
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHA
LDX #6
@X:
NOP
NOP
NOP
DEX
BNE @X
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #4
LDA #11
@A:
@A:
JSR @rts12
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @rts12
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #4
LDA #10
@A:
@A:
ROL $00,X
ROR $00,X
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}




=== 79 cycles ===
=== 68 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
LDX #13
PLA
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
@X:
@X:
PLA
PLA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
LDY #13
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
@Y:
@Y:
TSX
PLA
TXS
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, X, Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #12
@X:
@X:
NOP
PHA
PHA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #12
@Y:
@Y:
NOP
PHA
PHA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
!colspan="2"|9 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #13
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
PHA
LDX #8
@X:
@X:
NOP
NOP
NOP
NOP
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #6
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@Y:
PHP
NOP
SEC
NOP
LDA #11
NOP
@A:
NOP
SBC #1
DEY
BNE @A
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>CLC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #250
@A = * - 1
; ^ Hides !NOP
PHA
PHA
PHA
SEC
ADC #1
LDA #11
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires support for unofficial opcodes
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #4
PHP
SEC
LDA #8
@A:
@A:
JSR @rts14
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @rts14
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>CLC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #250
PHA
@A = * - 1
SEC
; ^ Hides !NOP
LDA #8
@A:
NOP
NOP
NOP
SBC #1
NOP
BNE @A
ADC #1
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|11 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
TXA
PHA
PHA
LDY #12
LDX #7
@Y:
@X:
DEY
NOP
BNE @Y
DEX
BNE @X
PLA
PLA
TAY
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|13 bytes
TYA
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
PHA
LDY #12
SEC
@Y:
LDA #7
DEY
@A:
BNE @Y
NOP
SBC #1
BNE @A
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
|}
|}




=== 80 cycles ===
=== 69 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|8 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #13
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #11
LDY #13
@A:
@Y:
NOP
DEY
SBC #1
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDX #13
LDA #14
@X:
@A:
DEX
SBC #1
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDY #13
LDA #14
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 81 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #16
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #16
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDX #13
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDY #13
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDX #13
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDY #13
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #13
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDX #13
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDX #13
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDY #13
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #136
SEC
LDA #137
@A = * - 1
@A = * - 1
; ^ Hides DEY
; ^ Hides !NOP #imm
PHA
NOP
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #136
PHA
@A = * - 1
PHP
; ^ Hides DEY
LDX #11
BIT $00
@X:
SBC #1
DEX
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, C, and V
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #136
LDA #6
@A = * - 1
@A:
; ^ Hides DEY
PHA
STA @zptemp
PHA
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @zptemp
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDA #136
SEC
LDA #137
@A = * - 1
@A = * - 1
; ^ Hides DEY
; ^ Hides !NOP #imm
NOP $00
NOP
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
Line 6,581: Line 6,879:
!colspan="2"|10 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #136
TYA
@A = * - 1
; ^ Hides DEY
JMP *+3
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
TXA
LDY #11
PHA
@Y:
LDX #11
DEY
@X:
BNE @Y
DEX
BNE @X
PLA
PLA
TAX
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
 
NOP
 
NOP
=== 82 cycles ===
PHP
{| class="wikitable"
LDY #11
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
@Y:
@Y:
PLA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
@Y:
NOP
NOP
NOP
NOP
DEY
PHP
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
LDX #11
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
@X:
@X:
NOP
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|9 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TXA
PHA
PHA
LDY #14
LDX #10
@Y:
@X:
DEY
DEX
BNE @Y
BNE @X
PLA
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
|-
NOP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHP
PHA
SEC
SEC
LDA #13
LDA #11
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #10
@A:
@A:
SBC #1
SBC #1
Line 6,665: Line 6,948:




=== 83 cycles ===
=== 70 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #15
LDX #13
@X:
@X:
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #15
LDY #13
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
!colspan="2"|7 bytes
LDA #16
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDY #13
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TXA
NOP
PHA
LDX #13
LDX #8
@X:
@X:
LDA $00
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLA
|-
TAX
!colspan="2"|8 bytes
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TXA
PHP
PHA
LDY #12
LDX #8
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #12
@X:
@X:
LDA $00
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
TAX
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #13
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|14 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #6
LDA #12
@A:
@A:
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
 
SEC
 
LDA #12
=== 84 cycles ===
@A:
{| class="wikitable"
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #9
PHP
PHA
SEC
LDA #10
@A:
@A:
NOP
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
|-
!colspan="2"|10 bytes
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TSX
PHA
LDY #9
LDA $00
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 71 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #14
@Y:
@Y:
PHA
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
TXS
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and Y
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #14
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #4
LDX #9
@X:
@X:
JSR @rts14
NOP
DEX
DEX
BNE @X
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #4
LDY #9
@Y:
@Y:
JSR @rts14
NOP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TXA
SEC
PHA
LDA #13
LDX #13
@A:
@X:
SBC #1
DEX
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
BNE @X
|-
PLA
!colspan="2"|9 bytes
TAX
|-
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDA #13
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
TXA
TYA
PHA
PHA
LDX #13
LDY #11
@X:
DEX
BNE @X
PLA
TAX
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #4
@Y:
@Y:
PHP
PLP
PHP
PLP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #4
PHA
@X:
SEC
PHP
LDA #136
PLP
@A = * - 1
PHP
; ^ Hides DEY
PLP
SBC #1
DEX
BMI @A
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}




=== 85 cycles ===
=== 72 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
LDX #13
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #12
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
LDY #13
@Y:
@Y:
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #12
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
LDX #13
@X:
@X:
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
LDY #13
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDA #13
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #11
LDX #8
@X:
@X:
NOP
BIT $00
DEX
DEX
BNE @X
BNE @X
Line 6,859: Line 7,191:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #11
LDY #8
@Y:
@Y:
NOP
BIT $00
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
!colspan="2"|9 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
SEC
LDA #15
LDA #12
@A:
@A:
SBC #1
SBC #1
Line 6,876: Line 7,209:
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
SEC
LDA #15
LDA #12
@A:
@A:
SBC #1
SBC #1
Line 6,884: Line 7,218:
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|14 bytes
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #4
LDA #11
@A:
@A:
JSR @rts12
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires @rts12
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TXA
PHA
LDX #6
@X:
NOP
NOP
NOP
DEX
BNE @X
PLA
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|15 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #4
@A:
ROL $00,X
ROR $00,X
SBC #1
SBC #1
BNE @A
BNE @A
Line 6,928: Line 7,233:




=== 86 cycles ===
=== 73 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #17
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #14
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #17
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #14
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #13
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #6
LDY #13
@Y:
@Y:
TSX
PLA
TXS
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #14
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #6
SEC
@Y:
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
NOP
NOP
SBC #1
NOP
BMI @A
NOP
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #6
SEC
@X:
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
NOP
NOP
SBC #1
NOP
BMI @A
NOP
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|12 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #4
LDA #9
@A:
@A:
JSR @rts14
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires @rts14
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
SEC
LDA #4
LDA #9
@A:
@A:
JSR @rts14
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @rts14
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
CLC
PHA
LDA #250
SEC
@A = * - 1
LDA #8
; ^ Hides !NOP
@A:
NOP
NOP
NOP
SBC #1
NOP
ADC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
CLC
LDA #250
@A = * - 1
; ^ Hides !NOP
NOP
NOP
NOP
ADC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
Line 7,040: Line 7,329:




=== 87 cycles ===
=== 74 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|8 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #14
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #12
LDX #14
@A:
@X:
NOP
DEX
SBC #1
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
PHA
LDY #14
LDY #15
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDX #14
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
SEC
LDY #14
LDA #11
@Y:
@A:
DEY
NOP
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
SEC
LDX #14
LDA #11
@X:
@A:
DEX
NOP
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
|-
LDY #14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
 
 
=== 88 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #16
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDX #16
LDX #14
@X:
@X:
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #14
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDX #14
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDA #17
LDX #14
@A:
@X:
SBC #1
DEX
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDY #14
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|9 bytes
SEC
LDA #136
@A = * - 1
; ^ Hides DEY
BIT $00
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
PHP
LDA #136
LDY #9
@A = * - 1
@Y:
; ^ Hides DEY
NOP
BIT $00
DEY
SBC #1
BNE @Y
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, C, and V
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
PHP
LDA #136
LDX #9
@A = * - 1
@X:
; ^ Hides DEY
NOP
STA @zptemp
DEX
SBC #1
BNE @X
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @zptemp
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PLA
SEC
SEC
LDA #136
LDA #13
@A = * - 1
@A:
; ^ Hides DEY
NOP $00
SBC #1
SBC #1
BMI @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|12 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
TYA
LDA #136
@A = * - 1
; ^ Hides DEY
JMP *+3
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|16 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TXA
PHA
PHA
LDX #3
LDY #12
@X:
@Y:
LDA $00
DEY
JSR @rts15
BNE @Y
DEX
BNE @X
PLA
PLA
TAX
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts15
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TXA
LDX #6
PHA
LDX #3
@X:
@X:
NOP
NOP
NOP
NOP
JSR @rts14
NOP
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
TAX
|-
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N; and requires @rts14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
|-
LDY #6
!colspan="2"|17 bytes
@Y:
NOP
NOP
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
TYA
PHA
PHA
LDY #3
LDY #11
@Y:
@Y:
NOP
NOP
PHP
PLP
PHP
PLP
DEY
DEY
BNE @Y
BNE @Y
Line 7,222: Line 7,481:
TAY
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
SEC
LDA #12
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}




=== 89 cycles ===
=== 75 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #14
@X:
@X:
PHA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #14
@Y:
@Y:
PHA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@X:
NOP
LDA $00
LDY #14
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
@Y:
LDA $00
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDX #14
@X:
@X:
BIT $00
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
!colspan="2"|8 bytes
@Y:
BIT $00
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #13
@Y:
@Y:
STA @zptemp
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #13
@X:
@X:
STA @zptemp
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
SEC
NOP $00
LDA #14
DEY
@A:
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
!colspan="2"|9 bytes
@X:
NOP $00
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
|-
SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
LDA #13
@X:
@A:
JMP *+3
SBC #1
DEX
BNE @A
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
@Y:
SEC
JMP *+3
LDA #13
DEY
@A:
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #9
@Y:
NOP
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #9
@X:
NOP
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #136
@A = * - 1
; ^ Hides DEY
NOP
NOP
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|10 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TXA
PHA
PHA
LDX #11
LDX #8
@X:
@X:
NOP
NOP
Line 7,345: Line 7,594:
BNE @X
BNE @X
PLA
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAX
|-
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHP
PHA
PHA
LDY #14
SEC
@Y:
LDA #11
DEY
@A:
BNE @Y
SBC #1
BNE @A
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|13 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
PHP
PHA
PHA
LDY #14
SEC
@Y:
LDA #8
DEY
@A:
BNE @Y
NOP
SBC #1
BNE @A
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
|}
|}




=== 90 cycles ===
=== 76 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|9 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #15
SEC
@X:
LDA #16
DEX
@A:
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #15
SEC
@Y:
LDA #16
DEY
@A:
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TSX
PHP
LDY #6
LDX #13
@Y:
PLA
PLA
DEY
BNE @Y
TXS
PLA</nowiki></pre> || style="padding:2px" | Clobbers X, Y, and Z&amp;N
|-
!colspan="2"|15 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
TXA
PHA
LDX #8
@X:
@X:
LDA $00
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
TAX
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
 
PHP
 
LDY #13
=== 91 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #18
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #18
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
!colspan="2"|7 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|-
SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #14
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $48 ;hides 'PHA'
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #11
@A:
@A:
PHA
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
Line 7,461: Line 7,666:
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA #11
@A:
BIT $00
BIT $00
SBC #1
LDY #13
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, C, and V
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDX #13
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDA #11
SEC
LDA #14
@A:
@A:
STA @zptemp
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires @zptemp
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
SEC
LDA #137
LDA #137
@A = * - 1
@A = * - 1
; ^ Hides !NOP #imm
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
NOP
SBC #1
SBC #1
BMI @A
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
SEC
LDA #137
LDA #137
@A = * - 1
@A = * - 1
; ^ Hides !NOP #imm
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
NOP
SBC #1
SBC #1
BMI @A
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|11 bytes
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #8
@Y:
LDA $00
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #11
PHP
SEC
LDA #9
@A:
@A:
JMP *+3
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
|-
PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #9
LDA #9
@A:
@A:
NOP
NOP
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
PHP
SEC
SEC
LDA #9
LDA #137
@A:
@A = * - 1
; ^ Hides !NOP #imm
NOP
NOP
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
NOP
SBC #1
SBC #1
BNE @A
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
|-
!colspan="2"|13 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHA
TXA
TYA
PHA
PHA
LDX #13
LDY #11
@X:
@Y:
DEX
DEY
BNE @X
BNE @Y
PLA
PLA
TAX
TAY
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
 
SEC
 
LDA #6
=== 92 cycles ===
@A:
{| class="wikitable"
NOP
!colspan="2"|6 bytes
NOP
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #13
!colspan="2"|13 bytes
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #13
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
@Y:
NOP
NOP
DEY
PHP
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #12
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #12
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #16
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #15
LDA #11
@A:
@A:
SBC #1
SBC #1
Line 7,614: Line 7,819:




=== 93 cycles ===
=== 77 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|7 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #17
PHA
LDY #14
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
LDX #14
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #17
NOP
NOP
LDX #14
@X:
@X:
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
LDY #14
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDA #18
SEC
LDA #14
@A:
@A:
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
!colspan="2"|11 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
PHA
LDY #9
LDY #13
@Y:
@Y:
NOP
NOP
DEY
DEY
BNE @Y
BNE @Y
Line 7,651: Line 7,873:
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|14 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDX #13
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PHA
SEC
SEC
LDA #4
LDA #13
@A:
@A:
JSR @rts14
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Requires @rts14
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
CLC
SEC
LDA #250
LDA #12
@A = * - 1
@A:
; ^ Hides !NOP
SBC #1
NOP
NOP
NOP
ADC #1
BNE @A
BNE @A
PLA
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}




=== 94 cycles ===
=== 78 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|8 bytes
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
LDA #13
@Y:
@A:
NOP
NOP
SBC #1
DEY
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
!colspan="2"|10 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDY #14
LDA #12
@Y:
@A:
DEY
NOP
BNE @Y
SBC #1
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #3
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
@Y:
LDX #14
LDX #5
@X:
@X:
DEX
DEX
BNE @X
BNE @X
DEY
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers X, Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #15
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
SEC
LDA #12
LDA #13
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
!colspan="2"|11 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
PHA
SEC
SEC
LDA #11
LDA #13
@A:
@A:
NOP
SBC #1
SBC #1
BNE @A
BNE @A
PLA
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
!colspan="2"|11 bytes
 
 
=== 95 cycles ===
{| class="wikitable"
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA $00
SEC
SEC
LDA #17
LDA #13
@A:
@A:
SBC #1
SBC #1
Line 7,763: Line 7,996:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
SEC
LDA #17
LDA #13
@A:
@A:
SBC #1
SBC #1
Line 7,773: Line 8,007:
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PLP
PHP
PHA
PHA
SEC
SEC
Line 7,778: Line 8,014:
@A = * - 1
@A = * - 1
; ^ Hides DEY
; ^ Hides DEY
BIT $00
SBC #1
SBC #1
BMI @A
BMI @A
Line 7,787: Line 8,022:




=== 96 cycles ===
=== 79 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|5 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #19
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #15
@Y:
@Y:
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #19
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #15
@X:
@X:
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
|-
!colspan="2"|9 bytes
!colspan="2"|7 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDY #11
LDY #15
@Y:
@Y:
BIT $00
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDX #11
LDX #15
@X:
@X:
BIT $00
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
!colspan="2"|10 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
|-
LDY #15
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #12
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDX #15
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
SEC
LDY #15
LDA #136
@Y:
@A = * - 1
DEY
; ^ Hides DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
NOP
NOP
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
SEC
LDX #15
LDA #136
@X:
@A = * - 1
DEX
; ^ Hides DEY
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
NOP
NOP
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|12 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #15
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
TXA
LDX #15
PHA
LDX #11
@X:
@X:
NOP
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
PLA
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
!colspan="2"|13 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
PHA
LDY #15
TYA
PHA
LDY #14
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
PLA
TAY
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
 
LDX #15
 
@X:
=== 97 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #12
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #12
@X:
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
PHP
PLP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
@X:
PHP
PLP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
Line 7,921: Line 8,104:
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
LDX #17
PHP
LDX #13
@X:
@X:
DEX
DEX
BNE @X
BNE @X
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
|-
!colspan="2"|11 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
PLA
SEC
SEC
LDA #16
LDA #14
@A:
@A:
SBC #1
SBC #1
BNE @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
PLA
|-
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
!colspan="2"|10 bytes
|-
|-
|}
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
 
TYA
 
PHA
=== 98 cycles ===
LDY #13
{| class="wikitable"
@Y:
!colspan="2"|7 bytes
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #18
NOP
NOP
PHP
LDX #13
@X:
@X:
DEX
DEX
Line 7,956: Line 8,162:
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
!colspan="2"|11 bytes
LDY #18
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #12
@Y:
@Y:
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDA #19
NOP
PHP
SEC
LDA #13
@A:
@A:
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
!colspan="2"|11 bytes
!colspan="2"|12 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
SEC
LDA #11
LDA #12
@A:
@A:
BIT $00
SBC #1
SBC #1
BNE @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLA
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #11
@A:
BIT $00
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, C, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #11
@A:
STA @zptemp
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #11
@A:
JMP *+3
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
Line 8,038: Line 8,201:




=== 99 cycles ===
=== 80 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|6 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #15
@Y:
@Y:
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #14
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #15
@X:
@X:
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
|-
!colspan="2"|8 bytes
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #11
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #13
LDX #11
@X:
@X:
NOP
NOP
DEX
DEX
BNE @X
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #13
PHP
LDY #14
@Y:
@Y:
NOP
DEY
DEY
BNE @Y
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #14
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #12
LDA #11
@A:
@A:
PHA
NOP
SBC #1
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #8
@A:
PHP
PLP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
SEC
LDA #137
LDA #14
@A = * - 1
@A:
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
SBC #1
BMI @A
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
SEC
LDA #137
LDA #137
@A = * - 1
@A = * - 1
; ^ Hides !NOP #imm
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
NOP
SBC #1
SBC #1
BMI @A
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
|-
!colspan="2"|11 bytes
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #16
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
TYA
PHA
PHA
LDY #16
SEC
@Y:
LDA #9
DEY
@A:
BNE @Y
NOP
SBC #1
BNE @A
PLA
PLA
TAY
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
|-
|}
|}




=== 100 cycles ===
=== 81 cycles ===
{| class="wikitable"
{| class="wikitable"
!colspan="2"|6 bytes
!colspan="2"|5 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #16
@Y:
@Y:
PLA
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #16
@X:
@X:
PLA
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
|-
!colspan="2"|7 bytes
!colspan="2"|8 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #14
@Y:
@Y:
NOP
NOP
DEY
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #14
@X:
@X:
NOP
NOP
DEX
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA #137
SEC
@A = * - 1
LDA #15
; ^ Hides !NOP #imm
@A:
NOP $EAEA ;hides two 'NOP's
SBC #1
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
|-
!colspan="2"|9 bytes
!colspan="2"|9 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
BIT $00
LDA #18
LDY #14
@A:
@Y:
SBC #1
DEY
BNE @A
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDX #14
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
SEC
LDA #18
LDA #15
@A:
@A:
SBC #1
SBC #1
BNE @A
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
|-
!colspan="2"|13 bytes
!colspan="2"|10 bytes
|-
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
TYA
TYA
PHA
PHA
LDY #9
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
TYA
PHA
LDY #12
@Y:
@Y:
NOP
NOP
DEY
DEY
BNE @Y
BNE @Y
Line 8,208: Line 8,428:
TAY
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 82 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
@Y:
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
@X:
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #9
@Y:
NOP
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #9
@X:
NOP
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDA #15
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDX #14
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 83 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #15
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #15
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #16
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S; and requires support for unofficial opcodes
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #8
@Y:
LDA $00
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|14 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #6
@A:
NOP
NOP
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 84 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>BIT $00
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>STA @zptemp
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP $00
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDX #16
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>JMP *+3
LDY #16
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDX #14
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
LDX #14
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 85 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #12
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #12
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #11
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #11
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #16
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #15
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDA $00
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 86 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #17
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #17
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #15
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #15
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #16
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDX #15
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDY #15
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 87 cycles ===
{| class="wikitable"
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #12
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #12
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #12
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #11
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #11
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 88 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #17
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #17
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #16
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #16
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #17
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
LDA #15
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
!colspan="2"|14 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 89 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
LDA $00
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
LDA $00
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
BIT $00
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
BIT $00
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, Z&amp;N, and V
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
STA @zptemp
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
STA @zptemp
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires @zptemp
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
NOP $00
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
NOP $00
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
JMP *+3
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
JMP *+3
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #9
@Y:
NOP
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #9
@X:
NOP
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TXA
PHA
LDX #11
@X:
NOP
DEX
BNE @X
PLA
TAX</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 90 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #17
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #17
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDX #17
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDY #17
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #16
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #16
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #17
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 91 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #18
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #18
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $48 ;hides 'PHA'
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #16
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #16
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #11
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDX #16
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
BIT $00
LDY #16
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDA $00
SEC
LDA #17
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, S, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 92 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #13
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #13
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #12
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #12
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDA #17
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #16
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 93 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #18
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #18
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #17
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #17
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #18
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
!colspan="2"|14 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
NOP
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 94 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDX #18
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDY #18
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #13
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #13
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #13
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #12
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #12
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 95 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDX #18
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
LDY #18
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDY #18
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
LDX #18
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #17
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #18
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 96 cycles ===
{| class="wikitable"
!colspan="2"|5 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #19
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #19
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
LDX #17
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #18
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #11
@Y:
BIT $00
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #11
@X:
BIT $00
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #13
@A:
NOP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #12
@Y:
NOP
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TXA
PHA
LDX #11
@X:
NOP
DEX
BNE @X
PLA
TAX
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 97 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #12
@X:
PHA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #12
@Y:
PHA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #8
@X:
PHP
PLP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #8
@Y:
PHP
PLP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PLA
SEC
LDA #18
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>TYA
PHA
LDY #17
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
LDX #17
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHA
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 98 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDY #19
@Y:
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
LDX #19
@X:
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #18
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #18
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #19
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A, and S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHA
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers S, Z&amp;N, and C
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #11
@A:
BIT $00
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
LDA $00
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 99 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #14
@Y:
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #14
@X:
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDX #13
@X:
NOP
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
LDY #13
@Y:
NOP
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #12
@A:
PHA
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, S, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #8
@A:
PHP
PLP
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A; and requires support for unofficial opcodes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|10 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
TYA
PHA
LDY #17
@Y:
DEY
BNE @Y
PLA
TAY</nowiki></pre> || style="padding:2px" | Clobbers A, and Z&amp;N
|-
!colspan="2"|11 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
TYA
PHA
LDY #16
@Y:
DEY
BNE @Y
PLA
TAY
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
NOP
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|}
=== 100 cycles ===
{| class="wikitable"
!colspan="2"|6 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
PLA
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers A, Y, S, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
PLA
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers A, X, S, and Z&amp;N
|-
!colspan="2"|7 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDX #11
@X:
NOP
NOP
DEX
BNE @X</nowiki></pre> || style="padding:2px" | Clobbers X, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>LDY #11
@Y:
NOP
NOP
DEY
BNE @Y</nowiki></pre> || style="padding:2px" | Clobbers Y, and Z&amp;N
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
SBC #1
BMI @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C; and requires support for unofficial opcodes
|-
!colspan="2"|8 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDY #18
@Y:
DEY
BNE @Y
PLP</nowiki></pre> || style="padding:2px" | Clobbers Y
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
LDX #18
@X:
DEX
BNE @X
PLP</nowiki></pre> || style="padding:2px" | Clobbers X
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
SEC
LDA #19
@A:
SBC #1
BNE @A</nowiki></pre> || style="padding:2px" | Clobbers A, Z&amp;N, and C
|-
!colspan="2"|9 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
SEC
LDA #18
@A:
SBC #1
BNE @A
PLP</nowiki></pre> || style="padding:2px" | Clobbers A
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
SEC
LDA #18
@A:
SBC #1
BNE @A
PLA</nowiki></pre> || style="padding:2px" | Clobbers Z&amp;N, and C
|-
!colspan="2"|12 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHA
PHP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers S
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>NOP
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Requires support for unofficial opcodes
|-
!colspan="2"|13 bytes
|-
| style="padding:2px" |<pre style="margin:2px;padding:3px"><nowiki>PHP
PHA
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP</nowiki></pre> || style="padding:2px" | Clobbers nothing, requires nothing
|-
|-
|}
|}

Revision as of 01:21, 14 March 2016

Delay code

Shortest possible CPU code that creates N cycles of delay, depending on constraints.

All branch instructions assume that no page wrap occurs.

Explanations on the requirements:

  • @zp_temp means you have a zeropage address that you can write random data into.
  • @rts12 means you know a memory address that contains byte $60 (RTS).
  • @rts14 means you know a memory address that contains a harmless 2-cycle instruction that fits your constraints (such as CLC, LDA #0, or NOP), followed by RTS.
  • @rts15 means you know a memory address that contains a JMP that jumps to another location that contains RTS.
  • Alternatively, @rts15 means you know a memory address that contains a harmless 3-cycle instruction that fits your constraints (such as LDA $00), followed by RTS.
  • @A, @X, @Y are local labels.


2 cycles

1 bytes
NOP
Clobbers nothing, requires nothing


3 cycles

1 bytes
PHA
Clobbers S
2 bytes
LDA $00
Clobbers A, and Z&N
BIT $00
Clobbers Z&N, and V
STA @zptemp
Requires @zptemp
NOP $00
Requires support for unofficial opcodes
3 bytes
JMP *+3
Clobbers nothing, requires nothing


4 cycles

1 bytes
PLA
Clobbers A, S, and Z&N
2 bytes
NOP
NOP
Clobbers nothing, requires nothing


5 cycles

2 bytes
NOP
PHA
Clobbers S
3 bytes
NOP
LDA $00
Clobbers A, and Z&N
NOP
BIT $00
Clobbers Z&N, and V
NOP
STA @zptemp
Requires @zptemp
NOP
NOP $00
Requires support for unofficial opcodes
4 bytes
NOP
JMP *+3
Clobbers nothing, requires nothing


6 cycles

2 bytes
PHA
PHA
Clobbers S
3 bytes
NOP
NOP
NOP
Clobbers nothing, requires nothing


7 cycles

2 bytes
PHP
PLP
Clobbers nothing, requires nothing


8 cycles

2 bytes
PLA
PLA
Clobbers A, S, and Z&N
3 bytes
TSX
PLA
TXS
Clobbers A, X, and Z&N
NOP
PHA
PHA
Clobbers S
4 bytes
NOP
NOP
NOP
NOP
Clobbers nothing, requires nothing


9 cycles

3 bytes
NOP
PHP
PLP
Clobbers nothing, requires nothing


10 cycles

3 bytes
PHA
PHP
PLP
Clobbers S
4 bytes
PHP
BIT $00
PLP
Clobbers nothing, requires nothing


11 cycles

3 bytes
PHA
PLA
PLA
Clobbers A, S, and Z&N
4 bytes
NOP
NOP
PHP
PLP
Clobbers nothing, requires nothing


12 cycles

3 bytes
JSR @rts12
Requires @rts12
PLA
PLA
PLA
Clobbers A, S, and Z&N
4 bytes
ROL $00,X
ROR $00,X
Clobbers Z&N
NOP
PHA
PHP
PLP
Clobbers S
5 bytes
NOP
PHP
BIT $00
PLP
Clobbers nothing, requires nothing


13 cycles

4 bytes
PHA
PHA
PHP
PLP
Clobbers S
5 bytes
NOP
NOP
NOP
PHP
PLP
Clobbers nothing, requires nothing


14 cycles

3 bytes
JSR @rts14
Requires @rts14
4 bytes
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


15 cycles

3 bytes
JSR @rts15
Requires @rts15
4 bytes
PHA
JSR @rts12
Clobbers S; and requires @rts12
PHA
PLA
PLA
PLA
Clobbers A, S, and Z&N
5 bytes
LDA $00
JSR @rts12
Clobbers A, and Z&N; and requires @rts12
PHA
TSX
PLA
TXS
PLA
Clobbers X, and Z&N
PHP
TSX
PLA
TXS
PLP
Clobbers A, and X
BIT $00
JSR @rts12
Clobbers Z&N, and V; and requires @rts12
STA @zptemp
JSR @rts12
Requires @zptemp, and @rts12
NOP
PHA
PHA
PHP
PLP
Clobbers S
NOP $00
JSR @rts12
Requires @rts12, and support for unofficial opcodes
6 bytes
NOP
NOP
NOP
NOP
PHP
PLP
Clobbers nothing, requires nothing


16 cycles

4 bytes
NOP
JSR @rts14
Requires @rts14
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
5 bytes
NOP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


17 cycles

4 bytes
NOP
JSR @rts15
Requires @rts15
PHA
JSR @rts14
Clobbers S; and requires @rts14
5 bytes
LDA $00
JSR @rts14
Clobbers A, and Z&N; and requires @rts14
BIT $00
JSR @rts14
Clobbers Z&N, and V; and requires @rts14
STA @zptemp
JSR @rts14
Requires @zptemp, and @rts14
PHA
PHP
PLP
PHP
PLP
Clobbers S
NOP $00
JSR @rts14
Requires @rts14, and support for unofficial opcodes
6 bytes
PHP
PLP
PHP
BIT $00
PLP
Clobbers nothing, requires nothing


18 cycles

4 bytes
PHA
JSR @rts15
Clobbers S; and requires @rts15
PLA
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
5 bytes
LDA $00
JSR @rts15
Clobbers A, and Z&N; and requires @rts15
BIT $00
JSR @rts15
Clobbers Z&N, and V; and requires @rts15
NOP
NOP
JSR @rts14
Requires @rts14
STA @zptemp
JSR @rts15
Requires @zptemp, and @rts15
PHA
PHA
JSR @rts12
Clobbers S; and requires @rts12
NOP
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP $00
JSR @rts15
Requires @rts15, and support for unofficial opcodes
6 bytes
NOP
NOP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


19 cycles

4 bytes
PLA
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
5 bytes
PHP
PLP
JSR @rts12
Requires @rts12
NOP
NOP
JSR @rts15
Requires @rts15
PHA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP
PHA
JSR @rts14
Clobbers S; and requires @rts14
6 bytes
PHP
ROL $00,X
ROR $00,X
PLP
Clobbers nothing, requires nothing


20 cycles

5 bytes
NOP
PHA
JSR @rts15
Clobbers S; and requires @rts15
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
PHA
PHA
JSR @rts14
Clobbers S; and requires @rts14
6 bytes
NOP
LDA $00
JSR @rts15
Clobbers A, and Z&N; and requires @rts15
TSX
PLA
PLA
PLA
PLA
TXS
Clobbers A, X, and Z&N
NOP
BIT $00
JSR @rts15
Clobbers Z&N, and V; and requires @rts15
NOP
NOP
NOP
JSR @rts14
Requires @rts14
NOP
STA @zptemp
JSR @rts15
Requires @zptemp, and @rts15
PHA
PHA
PHP
PLP
PHP
PLP
Clobbers S
NOP
NOP $00
JSR @rts15
Requires @rts15, and support for unofficial opcodes
7 bytes
NOP
NOP
NOP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


21 cycles

5 bytes
LDY #4
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #4
@X:
DEX
BNE @X
Clobbers X, and Z&N
PHP
PLP
JSR @rts14
Requires @rts14
PHA
PHA
JSR @rts15
Clobbers S; and requires @rts15
6 bytes
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


22 cycles

5 bytes
PHP
PLP
JSR @rts15
Requires @rts15
PLA
PLA
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
6 bytes
LDY #3
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #3
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
PHA
PHP
PLP
JSR @rts12
Clobbers S; and requires @rts12
NOP
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP
PHA
PHA
JSR @rts14
Clobbers S; and requires @rts14
7 bytes
PHP
BIT $00
PLP
JSR @rts12
Requires @rts12
PHP
PHA
TSX
PLA
TXS
PLA
PLP
Clobbers X
NOP
NOP
NOP
NOP
JSR @rts14
Requires @rts14
NOP
PHA
PHA
PHP
PLP
PHP
PLP
Clobbers S
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
8 bytes
NOP
NOP
NOP
NOP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


23 cycles

5 bytes
PLA
PLA
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
6 bytes
NOP
LDX #4
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #4
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
PHP
PLP
JSR @rts14
Requires @rts14
NOP
PHA
PHA
JSR @rts15
Clobbers S; and requires @rts15
PHA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
7 bytes
NOP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


24 cycles

6 bytes
JSR @rts12
JSR @rts12
Requires @rts12
NOP
PHP
PLP
JSR @rts15
Requires @rts15
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
PHA
LDX #4
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #4
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
PHP
PLP
JSR @rts14
Clobbers S; and requires @rts14
7 bytes
NOP
LDX #3
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #3
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
PHP
BIT $00
PLP
JSR @rts14
Requires @rts14
PHA
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires @zptemp, and support for unofficial opcodes
8 bytes
PHP
PLP
PHP
PLP
PHP
BIT $00
PLP
Clobbers nothing, requires nothing


25 cycles

6 bytes
PHA
PHP
PLP
JSR @rts15
Clobbers S; and requires @rts15
LDY #3
@Y:
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
LDX #3
@X:
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
PLA
PLA
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
7 bytes
PHP
BIT $00
PLP
JSR @rts15
Requires @rts15
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #2
@X:
PHP
PLP
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
PHP
PLP
JSR @rts14
Requires @rts14
PHA
PHA
PHP
PLP
JSR @rts12
Clobbers S; and requires @rts12
NOP
PHA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
8 bytes
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


26 cycles

5 bytes
LDY #5
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #5
@X:
DEX
BNE @X
Clobbers X, and Z&N
6 bytes
JSR @rts12
JSR @rts14
Requires @rts12, and @rts14
PHA
PLA
PLA
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
PLA
PLA
PLA
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
7 bytes
NOP
JSR @rts12
JSR @rts12
Requires @rts12
NOP
NOP
PHP
PLP
JSR @rts15
Requires @rts15
ROL $00,X
ROR $00,X
JSR @rts14
Clobbers Z&N; and requires @rts14
NOP
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP
PHA
PHP
PLP
JSR @rts14
Clobbers S; and requires @rts14
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
8 bytes
PHP
PLP
PHP
ROL $00,X
ROR $00,X
PLP
Clobbers nothing, requires nothing


27 cycles

6 bytes
JSR @rts12
JSR @rts15
Requires @rts12, and @rts15
PLA
PLA
PLA
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
7 bytes
ROL $00,X
ROR $00,X
JSR @rts15
Clobbers Z&N; and requires @rts15
PHA
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
NOP
PHA
PHP
PLP
JSR @rts15
Clobbers S; and requires @rts15
PHA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP
LDX #3
@X:
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
NOP
LDY #3
@Y:
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
PHA
PHP
PLP
JSR @rts14
Clobbers S; and requires @rts14
8 bytes
NOP
PHP
BIT $00
PLP
JSR @rts15
Requires @rts15
LDA $00
JSR @rts12
JSR @rts12
Clobbers A, and Z&N; and requires @rts12
PHA
TSX
PLA
PLA
PLA
PLA
TXS
PLA
Clobbers X, and Z&N
NOP
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
Clobbers Y, and Z&N
PHP
TSX
PLA
PLA
PLA
PLA
TXS
PLP
Clobbers A, and X
BIT $00
JSR @rts12
JSR @rts12
Clobbers Z&N, and V; and requires @rts12
NOP
NOP
NOP
PHP
PLP
JSR @rts14
Requires @rts14
STA @zptemp
JSR @rts12
JSR @rts12
Requires @zptemp, and @rts12
PHA
PHA
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
NOP $00
JSR @rts12
JSR @rts12
Requires @rts12, and support for unofficial opcodes
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
9 bytes
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


28 cycles

6 bytes
NOP
LDX #5
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #5
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
JSR @rts14
JSR @rts14
Requires @rts14
7 bytes
PHP
LDX #4
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #4
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #5
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
PHA
PHP
PLP
JSR @rts15
Clobbers S; and requires @rts15
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
8 bytes
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


29 cycles

6 bytes
LDX #4
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
LDY #4
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
7 bytes
PHP
PLP
PHP
PLP
JSR @rts15
Requires @rts15
PHA
JSR @rts12
JSR @rts14
Clobbers S; and requires @rts12, and @rts14
PHA
PLA
PLA
PLA
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
8 bytes
PHP
LDY #3
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #3
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
LDA $00
JSR @rts12
JSR @rts14
Clobbers A, and Z&N; and requires @rts12, and @rts14
BIT $00
JSR @rts12
JSR @rts14
Clobbers Z&N, and V; and requires @rts12, and @rts14
STA @zptemp
JSR @rts12
JSR @rts14
Requires @zptemp, @rts12, and @rts14
NOP
PHA
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
NOP
PHA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP
PHA
PHA
PHP
PLP
JSR @rts14
Clobbers S; and requires @rts14
NOP $00
JSR @rts12
JSR @rts14
Requires @rts12, @rts14, and support for unofficial opcodes
9 bytes
PHP
PLP
PHP
BIT $00
PLP
JSR @rts12
Requires @rts12
NOP
NOP
NOP
NOP
PHP
PLP
JSR @rts14
Requires @rts14
NOP
PHA
PHA
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
10 bytes
NOP
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


30 cycles

6 bytes
JSR @rts15
JSR @rts15
Requires @rts15
PLA
LDX #5
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #5
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDY #5
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #5
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
JSR @rts14
JSR @rts14
Requires @rts14
8 bytes
NOP
PHP
LDY #4
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #4
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #5
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
PHA
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
NOP
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
9 bytes
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


31 cycles

5 bytes
LDX #6
@X:
DEX
BNE @X
Clobbers X, and Z&N
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
NOP
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
PLA
PLA
PLA
PLA
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
PHA
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
8 bytes
PHP
PLP
JSR @rts12
JSR @rts12
Requires @rts12
NOP
PHP
PLP
PHP
PLP
JSR @rts15
Requires @rts15
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
LDA $00
JSR @rts14
JSR @rts14
Clobbers A, and Z&N; and requires @rts14
BIT $00
JSR @rts14
JSR @rts14
Clobbers Z&N, and V; and requires @rts14
STA @zptemp
JSR @rts14
JSR @rts14
Requires @zptemp, and @rts14
PHA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
PHA
PHP
LDY #4
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #4
@X:
DEX
BNE @X
PLP
Clobbers X, and S
NOP $00
JSR @rts14
JSR @rts14
Requires @rts14, and support for unofficial opcodes
9 bytes
NOP
PHP
LDX #3
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
NOP
PHP
LDY #3
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
JMP *+3
JSR @rts14
JSR @rts14
Requires @rts14
PHA
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
SBC #1
BMI @A
PLP
Clobbers A; and requires @zptemp, and support for unofficial opcodes
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires @zptemp, and support for unofficial opcodes
10 bytes
PHP
PLP
PHP
PLP
PHP
PLP
PHP
BIT $00
PLP
Clobbers nothing, requires nothing


32 cycles

7 bytes
NOP
JSR @rts15
JSR @rts15
Requires @rts15
PHA
LDX #4
@X:
NOP
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #4
@Y:
NOP
DEY
BNE @Y
Clobbers Y, S, and Z&N
PLA
JSR @rts14
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
8 bytes
NOP
NOP
NOP
LDY #5
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
NOP
LDX #5
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
JSR @rts14
JSR @rts14
Requires @rts14
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
9 bytes
TYA
PHA
LDY #4
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHP
LDX #2
@X:
PHP
PLP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHA
PHA
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
10 bytes
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


33 cycles

6 bytes
NOP
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #6
@X:
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
PHP
LDY #5
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #5
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #6
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
8 bytes
LDA $00
JSR @rts15
JSR @rts15
Clobbers A, and Z&N; and requires @rts15
BIT $00
JSR @rts15
JSR @rts15
Clobbers Z&N, and V; and requires @rts15
PHP
PLP
JSR @rts12
JSR @rts14
Requires @rts12, and @rts14
NOP
NOP
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
STA @zptemp
JSR @rts15
JSR @rts15
Requires @zptemp, and @rts15
NOP
PHA
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
NOP $00
JSR @rts15
JSR @rts15
Requires @rts15, and support for unofficial opcodes
9 bytes
NOP
PHP
PLP
JSR @rts12
JSR @rts12
Requires @rts12
JMP *+3
JSR @rts15
JSR @rts15
Requires @rts15
JSR @rts14
PHP
ROL $00,X
ROR $00,X
PLP
Requires @rts14
NOP
PHA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
10 bytes
PHP
PLP
PHP
PLP
PHP
ROL $00,X
ROR $00,X
PLP
Clobbers nothing, requires nothing


34 cycles

6 bytes
PHA
LDX #6
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDA $00
LDX #6
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
LDA $00
LDY #6
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
BIT $00
LDX #6
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
BIT $00
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
STA @zptemp
LDX #6
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
STA @zptemp
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
PLA
JSR @rts15
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
NOP $00
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
NOP $00
LDX #6
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
8 bytes
NOP
NOP
JSR @rts15
JSR @rts15
Requires @rts15
JMP *+3
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
JMP *+3
LDX #6
@X:
DEX
BNE @X
Clobbers X, and Z&N
PHA
PHA
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
9 bytes
NOP
NOP
NOP
JSR @rts14
JSR @rts14
Requires @rts14
PHA
PHP
PLP
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
NOP
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
PHA
PHA
PHP
LDX #4
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHA
PHP
LDY #4
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
10 bytes
PHP
BIT $00
PLP
JSR @rts12
JSR @rts12
Requires @rts12
NOP
TYA
PHA
LDY #4
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
PHP
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
PLP
Clobbers Y
PHP
PHA
TSX
PLA
PLA
PLA
PLA
TXS
PLA
PLP
Clobbers X
PHA
PHA
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
11 bytes
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


35 cycles

6 bytes
PLA
LDY #6
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
PLA
LDX #6
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
NOP
NOP
LDX #6
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
LDY #6
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
NOP
PHP
LDY #5
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #5
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #6
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHP
PLP
JSR @rts14
JSR @rts14
Requires @rts14
NOP
PHA
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
9 bytes
PHP
SEC
LDA #5
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
NOP
BIT $00
JSR @rts15
JSR @rts15
Clobbers Z&N, and V; and requires @rts15
NOP
STA @zptemp
JSR @rts15
JSR @rts15
Requires @zptemp, and @rts15
NOP
NOP $00
JSR @rts15
JSR @rts15
Requires @rts15, and support for unofficial opcodes
10 bytes
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


36 cycles

5 bytes
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHP
LDX #4
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #4
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHP
PLP
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
PHA
PHA
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
PLA
PLA
JSR @rts14
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
9 bytes
JSR @rts12
JSR @rts12
JSR @rts12
Requires @rts12
NOP
NOP
NOP
JSR @rts15
JSR @rts15
Requires @rts15
LDA $00
SEC
LDA #6
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
PLA
Clobbers A, S, and Z&N
NOP
PHA
PHA
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
10 bytes
NOP
NOP
NOP
NOP
JSR @rts14
JSR @rts14
Requires @rts14
PHA
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLP
Clobbers A, and S; and requires support for unofficial opcodes
PHA
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLA
Clobbers S, Z&N, and C; and requires support for unofficial opcodes
11 bytes
TYA
PHA
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
PHA
PHA
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
12 bytes
NOP
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


37 cycles

6 bytes
LDY #4
@Y:
PLA
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
LDX #4
@X:
PLA
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
LDX #3
@X:
PHP
PLP
DEX
BNE @X
Clobbers X, and Z&N
LDY #3
@Y:
PHP
PLP
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHP
PLP
JSR @rts15
JSR @rts15
Requires @rts15
PLA
SEC
LDA #6
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDX #5
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
PHP
LDY #5
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
PLP
JSR @rts14
JSR @rts14
Requires @rts14
10 bytes
NOP
PHP
SEC
LDA #5
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
PHA
PHA
PHP
PLP
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
11 bytes
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


38 cycles

6 bytes
NOP
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
PHP
LDY #6
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #6
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #7
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
8 bytes
PLA
PLA
JSR @rts15
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
9 bytes
JSR @rts12
JSR @rts12
JSR @rts14
Requires @rts12, and @rts14
NOP
PHP
PLP
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
NOP
PHA
PHA
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
PHA
PHP
PLP
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
10 bytes
NOP
JSR @rts12
JSR @rts12
JSR @rts12
Requires @rts12
NOP
NOP
NOP
NOP
JSR @rts15
JSR @rts15
Requires @rts15
PHP
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
PHP
BIT $00
PLP
JSR @rts14
JSR @rts14
Requires @rts14
11 bytes
PHA
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
.byte $0C,$E6,@zptemp ;NOP abs; hides 'INC @zptemp'
SBC #1
BMI @A
PLA
PLP
Requires @zptemp, and support for unofficial opcodes
12 bytes
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
BIT $00
PLP
Clobbers nothing, requires nothing


39 cycles

6 bytes
PHA
LDX #7
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDA $00
LDY #7
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
LDA $00
LDX #7
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
BIT $00
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
BIT $00
LDX #7
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
STA @zptemp
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
STA @zptemp
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
NOP $00
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
NOP $00
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N
JMP *+3
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
9 bytes
NOP
PHP
PLP
JSR @rts15
JSR @rts15
Requires @rts15
SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
PHP
LDY #4
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #4
@X:
NOP
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PLA
PLA
JSR @rts14
JSR @rts14
Clobbers A, S, and Z&N; and requires @rts14
10 bytes
NOP
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
NOP
PHP
LDX #5
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
NOP
PHP
LDY #5
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
PHP
PLP
JSR @rts14
JSR @rts14
Requires @rts14
PHA
JSR @rts12
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
11 bytes
PHA
TYA
PHA
LDY #4
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #5
@A:
SBC #1
BNE @A
PLP
Clobbers A
STA @zptemp
JSR @rts12
JSR @rts12
JSR @rts12
Requires @zptemp, and @rts12
NOP $00
JSR @rts12
JSR @rts12
JSR @rts12
Requires @rts12, and support for unofficial opcodes
12 bytes
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


40 cycles

6 bytes
PLA
LDX #7
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #7
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #6
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #6
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #7
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #6
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
JSR @rts12
JSR @rts14
JSR @rts14
Requires @rts12, and @rts14
PHA
PHP
PLP
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
10 bytes
PHP
BIT $00
PLP
JSR @rts15
JSR @rts15
Requires @rts15
ROL $00,X
ROR $00,X
JSR @rts14
JSR @rts14
Clobbers Z&N; and requires @rts14
NOP
PHA
PHP
PLP
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
11 bytes
NOP
NOP
JSR @rts12
JSR @rts12
JSR @rts12
Requires @rts12
NOP
PHP
BIT $00
PLP
JSR @rts14
JSR @rts14
Requires @rts14
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
12 bytes
PHP
PLP
PHP
PLP
PHP
PLP
PHP
ROL $00,X
ROR $00,X
PLP
Clobbers nothing, requires nothing


41 cycles

5 bytes
LDX #8
@X:
DEX
BNE @X
Clobbers X, and Z&N
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHA
PHP
LDX #6
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHP
LDY #6
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDY #6
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
BIT $00
LDX #6
@X:
DEX
BNE @X
PLP
Clobbers X
LDA $00
SEC
LDA #7
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
JSR @rts12
JSR @rts14
JSR @rts15
Requires @rts12, @rts14, and @rts15
PHA
PLA
PLA
JSR @rts15
JSR @rts15
Clobbers A, S, and Z&N; and requires @rts15
10 bytes
NOP
NOP
PHP
PLP
JSR @rts15
JSR @rts15
Requires @rts15
PLA
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
PHA
PHA
PHP
PLP
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
11 bytes
NOP
NOP
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
NOP
PHP
PLP
JSR @rts14
JSR @rts14
Requires @rts14
NOP
PHA
JSR @rts12
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
PHA
PHP
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
PHP
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
12 bytes
PHP
PLP
PHP
BIT $00
PLP
JSR @rts12
JSR @rts12
Requires @rts12
NOP
PHA
TYA
PHA
LDY #4
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
NOP
PHP
SEC
LDA #5
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
PHA
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
NOP
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
13 bytes
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


42 cycles

7 bytes
PHA
PHA
LDX #7
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
PHA
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
8 bytes
NOP
NOP
NOP
LDX #7
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
NOP
LDY #7
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
PLA
SEC
LDA #7
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
JSR @rts12
JSR @rts15
JSR @rts15
Requires @rts12, and @rts15
TYA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDX #6
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
PHP
LDY #6
@Y:
DEY
BNE @Y
PLP
Clobbers Y
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
10 bytes
ROL $00,X
ROR $00,X
JSR @rts15
JSR @rts15
Clobbers Z&N; and requires @rts15
NOP
PHP
SEC
LDA #6
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
NOP
PHA
PHP
PLP
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
11 bytes
PHP
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


43 cycles

6 bytes
LDX #6
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
LDY #6
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #8
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
JSR @rts14
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
10 bytes
PHA
PHA
PHP
PLP
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
PHA
PHP
SEC
LDA #6
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
PHA
JSR @rts12
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts12, and @rts14
11 bytes
PHP
PLP
JSR @rts12
JSR @rts12
JSR @rts12
Requires @rts12
NOP
NOP
NOP
PHP
PLP
JSR @rts15
JSR @rts15
Requires @rts15
PHP
LDA $00
SEC
LDA #6
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
NOP
PHA
PHA
PHP
PLP
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
12 bytes
NOP
NOP
NOP
NOP
PHP
PLP
JSR @rts14
JSR @rts14
Requires @rts14
PHA
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $2808 ;hides 'PHP' and 'PLP'; reads from $2000
SBC #1
BMI @A
PLA
PLP
Clobbers S; and requires support for unofficial opcodes
13 bytes
PHA
TYA
PHA
LDY #2
@Y:
PHP
PLP
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
PHA
PHA
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers S
PHP
PLP
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
14 bytes
NOP
NOP
NOP
NOP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
PHP
PLP
Clobbers nothing, requires nothing


44 cycles

6 bytes
PHA
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
LDX #8
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
7 bytes
LDA $00
LDY #8
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
LDA $00
LDX #8
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
BIT $00
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
BIT $00
LDX #8
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
STA @zptemp
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
STA @zptemp
LDX #8
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
NOP $00
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
NOP $00
LDX #8
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
JMP *+3
LDX #8
@X:
DEX
BNE @X
Clobbers X, and Z&N
9 bytes
PHP
LDY #3
@Y:
PHP
PLP
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #3
@X:
PHP
PLP
DEX
BNE @X
PLP
Clobbers X
JSR @rts14
JSR @rts15
JSR @rts15
Requires @rts14, and @rts15
NOP
PLA
SEC
LDA #7
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
10 bytes
PHP
PLP
PHP
PLP
JSR @rts15
JSR @rts15
Requires @rts15
NOP
TYA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
11 bytes
PHA
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #6
@A:
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


45 cycles

6 bytes
PLA
LDY #8
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
PLA
LDX #8
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
NOP
LDY #6
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #6
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
10 bytes
PHA
JSR @rts14
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
11 bytes
PHP
PLP
JSR @rts12
JSR @rts12
JSR @rts14
Requires @rts12, and @rts14
BIT $00
JSR @rts14
JSR @rts14
JSR @rts14
Clobbers Z&N, and V; and requires @rts14
STA @zptemp
JSR @rts14
JSR @rts14
JSR @rts14
Requires @zptemp, and @rts14
NOP $00
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14, and support for unofficial opcodes
12 bytes
PHP
PHA
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


46 cycles

5 bytes
LDX #9
@X:
DEX
BNE @X
Clobbers X, and Z&N
LDY #9
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHA
PHP
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
BIT $00
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y
LDA $00
SEC
LDA #8
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
NOP
JSR @rts14
JSR @rts15
JSR @rts15
Requires @rts14, and @rts15
PLA
TYA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
NOP
PHP
PLP
PHP
PLP
JSR @rts15
JSR @rts15
Requires @rts15
PHP
SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
NOP
NOP
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
12 bytes
NOP
PHA
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHA
PHP
PLP
JSR @rts12
JSR @rts12
JSR @rts12
Clobbers S; and requires @rts12
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


47 cycles

7 bytes
PHA
PHA
LDX #8
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
PHA
LDY #8
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
8 bytes
NOP
NOP
LDX #6
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
LDY #6
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
PLA
SEC
LDA #8
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y
10 bytes
NOP
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15
NOP
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


48 cycles

6 bytes
NOP
LDX #9
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #9
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #8
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #8
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #9
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
JSR @rts15
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
PHA
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
LDA $00
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
BIT $00
JSR @rts15
JSR @rts15
JSR @rts15
Clobbers Z&N, and V; and requires @rts15
NOP
NOP
JSR @rts14
JSR @rts15
JSR @rts15
Requires @rts14, and @rts15
STA @zptemp
JSR @rts15
JSR @rts15
JSR @rts15
Requires @zptemp, and @rts15
PHA
PHA
JSR @rts14
JSR @rts14
JSR @rts14
Clobbers S; and requires @rts14
NOP $00
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15, and support for unofficial opcodes
12 bytes
JSR @rts12
JSR @rts12
JSR @rts12
JSR @rts12
Requires @rts12
JMP *+3
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15
NOP
NOP
NOP
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
13 bytes
NOP
NOP
PHA
TYA
PHA
LDY #5
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHA
PHP
PHA
SEC
LDA #4
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers S
PHP
PHA
SEC
LDA #130
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA ;hides 'NOP'
PHP
PLP
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
14 bytes
NOP
NOP
NOP
PHP
PHA
SEC
LDA #5
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


49 cycles

6 bytes
LDY #6
@Y:
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
LDX #6
@X:
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
7 bytes
LDY #4
@Y:
PHP
PLP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #4
@X:
PHP
PLP
DEX
BNE @X
Clobbers X, and Z&N
9 bytes
PHA
PHA
PHP
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHA
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
NOP
PLA
SEC
LDA #8
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
10 bytes
NOP
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
NOP
PHP
LDY #7
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
NOP
PHP
LDX #7
@X:
DEX
BNE @X
PLP
Clobbers X
11 bytes
NOP
NOP
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15
PHA
TYA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHP
PLP
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
12 bytes
NOP
PHP
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


50 cycles

6 bytes
LDX #7
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
LDY #7
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHP
LDX #6
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #6
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
NOP
SEC
LDA #9
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #8
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PLP
JSR @rts14
JSR @rts14
JSR @rts15
Requires @rts14, and @rts15
NOP
PHA
JSR @rts15
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
12 bytes
NOP
BIT $00
JSR @rts15
JSR @rts15
JSR @rts15
Clobbers Z&N, and V; and requires @rts15
JSR @rts12
JSR @rts12
JSR @rts12
JSR @rts14
Requires @rts12, and @rts14
NOP
STA @zptemp
JSR @rts15
JSR @rts15
JSR @rts15
Requires @zptemp, and @rts15
PHA
PHP
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
NOP
NOP $00
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15, and support for unofficial opcodes
13 bytes
PHP
PHA
LDA $00
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


51 cycles

5 bytes
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #10
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHA
PHP
LDX #8
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHP
LDY #8
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
SEC
LDA #6
@A:
PHA
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDY #8
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
BIT $00
LDX #8
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #4
@A:
PHP
PLP
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PLA
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
NOP
NOP
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHP
PLP
JSR @rts14
JSR @rts15
JSR @rts15
Requires @rts14, and @rts15
PHA
PHA
JSR @rts15
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
PHA
PHA
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
12 bytes
NOP
NOP
NOP
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15
NOP
PHA
TYA
PHA
LDY #6
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
NOP
PHP
SEC
LDA #7
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHP
PLP
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #6
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


52 cycles

7 bytes
NOP
LDY #7
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #7
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
TYA
PHA
LDY #8
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
PHP
LDY #6
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #6
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
10 bytes
PHP
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


53 cycles

6 bytes
NOP
LDX #10
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #9
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #9
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #10
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #8
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
LDA $00
SEC
LDA #8
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
NOP
PHP
PLP
JSR @rts14
JSR @rts15
JSR @rts15
Requires @rts14, and @rts15
NOP
PHA
PHA
JSR @rts15
JSR @rts15
JSR @rts15
Clobbers S; and requires @rts15
13 bytes
PHP
PHA
SEC
LDA #3
@A:
PHP
PLP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


54 cycles

6 bytes
PHA
LDX #10
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDA $00
LDX #10
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
LDA $00
LDY #10
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
BIT $00
LDX #10
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
BIT $00
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
STA @zptemp
LDX #10
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
STA @zptemp
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
NOP $00
LDX #10
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
NOP $00
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDY #10
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
JMP *+3
LDX #10
@X:
DEX
BNE @X
Clobbers X, and Z&N
9 bytes
NOP
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
PHA
PHP
LDY #8
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHA
PHP
LDX #8
@X:
DEX
BNE @X
PLP
Clobbers X, and S
10 bytes
TYA
PHA
LDY #6
@Y:
NOP
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDX #6
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
PHP
LDY #6
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
11 bytes
PHA
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
PHP
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


55 cycles

6 bytes
LDY #6
@Y:
PLA
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
LDX #6
@X:
PLA
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
LDY #6
@Y:
NOP
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #6
@X:
NOP
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #9
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #9
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #10
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #9
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
JSR @rts12
JSR @rts14
JSR @rts14
JSR @rts15
Requires @rts12, @rts14, and @rts15
PHA
PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
LDA $00
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


56 cycles

5 bytes
LDY #11
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #11
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHA
PHP
LDY #9
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #9
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
LDX #4
@X:
PHP
PLP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #4
@Y:
PHP
PLP
DEY
BNE @Y
PLP
Clobbers Y
LDA $00
SEC
LDA #10
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PLA
TYA
PHA
LDY #8
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
NOP
TYA
PHA
LDY #6
@Y:
NOP
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHA
PHA
PHP
SEC
LDA #8
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
12 bytes
NOP
PHA
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


57 cycles

6 bytes
LDX #8
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
LDY #8
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
SEC
LDA #136
@A = * - 1
; ^ Hides DEY
SBC #1
BMI @A
Clobbers A, Z&N, and C
8 bytes
PHP
LDY #7
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #7
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
9 bytes
TYA
PHA
LDY #9
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
10 bytes
NOP
PHP
SEC
LDA #9
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


58 cycles

6 bytes
NOP
LDX #11
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #11
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDY #10
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #10
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #11
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #9
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
SEC
LDA #4
@A:
PHP
PLP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #4
@A:
PHP
PLP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
JSR @rts14
JSR @rts14
JSR @rts15
JSR @rts15
Requires @rts14, and @rts15
13 bytes
NOP
NOP
PHA
TYA
PHA
LDY #7
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
JSR @rts14
JSR @rts14
JSR @rts14
JSR @rts14
Requires @rts14
PHA
PHA
PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
14 bytes
NOP
NOP
NOP
PHP
PHA
SEC
LDA #7
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


59 cycles

6 bytes
PHA
LDX #11
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #11
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
NOP
LDY #8
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #8
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
NOP
PHP
LDY #7
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #7
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
10 bytes
PHP
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHA
TYA
PHA
LDY #8
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
12 bytes
PHP
PHA
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


60 cycles

6 bytes
PLA
LDX #11
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #11
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDY #11
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #11
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #10
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #10
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #11
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #10
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
JSR @rts15
JSR @rts15
JSR @rts15
JSR @rts15
Requires @rts15
PHA
PHP
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
LDA $00
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


61 cycles

5 bytes
LDY #12
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #12
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHA
PHP
LDY #10
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #10
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDY #10
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
BIT $00
LDX #10
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
TXA
PHA
LDX #7
@X:
NOP
DEX
BNE @X
PLA
TAX
Clobbers A, and Z&N
11 bytes
NOP
PHP
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
TYA
PHA
LDY #6
@Y:
NOP
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
13 bytes
NOP
PHP
PHA
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


62 cycles

7 bytes
PHA
PHA
LDY #11
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
PHA
LDX #11
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
8 bytes
NOP
NOP
NOP
LDX #11
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
NOP
LDY #11
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
PLA
SEC
LDA #11
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TXA
PHA
LDX #10
@X:
DEX
BNE @X
PLA
TAX
Clobbers A, and Z&N
PHP
LDX #6
@X:
NOP
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #6
@Y:
NOP
NOP
DEY
BNE @Y
PLP
Clobbers Y
10 bytes
NOP
PHP
SEC
LDA #10
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


63 cycles

6 bytes
NOP
LDX #12
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #12
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #11
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #12
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #10
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
LDA $00
SEC
LDA #10
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
13 bytes
NOP
PHA
TYA
PHA
LDY #6
@Y:
NOP
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHA
PHA
PHP
PHA
SEC
LDA #8
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
14 bytes
NOP
NOP
PHP
PHA
SEC
LDA #6
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


64 cycles

6 bytes
LDY #9
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #9
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHP
LDY #8
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #8
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
9 bytes
PHP
SEC
LDA #136
@A = * - 1
; ^ Hides DEY
SBC #1
BMI @A
PLP
Clobbers A
PHA
SEC
LDA #136
@A = * - 1
; ^ Hides DEY
SBC #1
BMI @A
PLA
Clobbers Z&N, and C
11 bytes
PHA
TYA
PHA
LDY #9
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
12 bytes
NOP
PHP
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


65 cycles

6 bytes
LDX #8
@X:
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
LDY #8
@Y:
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
NOP
NOP
LDY #12
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #12
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #11
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #12
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #11
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #9
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
SEC
LDA #4
@A:
PHP
PLP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


66 cycles

5 bytes
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
8 bytes
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #11
@X:
DEX
BNE @X
PLP
Clobbers X, and S
9 bytes
NOP
PHP
LDY #8
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #8
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
10 bytes
PHP
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHP
PHA
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


67 cycles

7 bytes
LDY #6
@Y:
PHA
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
LDX #6
@X:
PHA
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
8 bytes
LDY #6
@Y:
NOP
NOP
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #6
@X:
NOP
NOP
NOP
DEX
BNE @X
Clobbers X, and Z&N
SEC
LDA #8
@A:
PHA
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #11
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDX #11
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP
Clobbers Y
10 bytes
NOP
PHP
SEC
LDA #11
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


68 cycles

6 bytes
NOP
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #12
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #12
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #13
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
TXA
PHA
LDX #8
@X:
NOP
DEX
BNE @X
PLA
TAX
Clobbers A, and Z&N
PHA
PHP
SEC
LDA #11
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
NOP
PHP
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
TXA
PHA
LDX #7
@X:
NOP
DEX
BNE @X
PLA
TAX
PLA
Clobbers Z&N
13 bytes
NOP
PHP
PHA
SEC
LDA #7
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


69 cycles

6 bytes
PHA
LDX #13
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDA $00
LDX #13
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
LDA $00
LDY #13
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
BIT $00
LDX #13
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
BIT $00
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
STA @zptemp
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
STA @zptemp
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
NOP $00
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
NOP $00
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N
JMP *+3
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
Clobbers A, S, Z&N, and C; and requires support for unofficial opcodes
9 bytes
PHA
PHA
PHP
LDX #11
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHA
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
SEC
LDA #6
@A:
PHA
PHA
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
LDA $00
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
10 bytes
NOP
TYA
PHA
LDY #11
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
NOP
PHP
LDY #11
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
NOP
PHP
LDX #11
@X:
DEX
BNE @X
PLP
Clobbers X
11 bytes
PHA
TXA
PHA
LDX #10
@X:
DEX
BNE @X
PLA
TAX
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #11
@A:
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


70 cycles

6 bytes
PLA
LDX #13
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #13
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #12
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #12
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #13
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #12
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
LDA $00
SEC
LDA #10
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


71 cycles

5 bytes
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHP
LDX #9
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #9
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
LDA $00
SEC
LDA #13
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PLA
TYA
PHA
LDY #11
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
PHP
PHA
SEC
LDA #136
@A = * - 1
; ^ Hides DEY
SBC #1
BMI @A
PLA
PLP
Clobbers nothing, requires nothing


72 cycles

7 bytes
PHA
PHA
LDX #13
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
PHA
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
8 bytes
NOP
NOP
NOP
LDX #13
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
NOP
LDY #13
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
PLA
SEC
LDA #13
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHP
LDX #8
@X:
BIT $00
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #8
@Y:
BIT $00
DEY
BNE @Y
PLP
Clobbers Y
10 bytes
NOP
PHP
SEC
LDA #12
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


73 cycles

6 bytes
NOP
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #14
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
10 bytes
PHP
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHP
PHA
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


74 cycles

6 bytes
PHA
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
LDX #14
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
7 bytes
LDA $00
LDY #14
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
LDA $00
LDX #14
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
BIT $00
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
BIT $00
LDX #14
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
STA @zptemp
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
STA @zptemp
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
NOP $00
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
NOP $00
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N
JMP *+3
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
9 bytes
PHA
PHP
LDY #9
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #9
@X:
NOP
DEX
BNE @X
PLP
Clobbers X, and S
NOP
PLA
SEC
LDA #13
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
10 bytes
NOP
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHP
LDX #6
@X:
NOP
NOP
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #6
@Y:
NOP
NOP
NOP
DEY
BNE @Y
PLP
Clobbers Y
11 bytes
PHA
TYA
PHA
LDY #11
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #12
@A:
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


75 cycles

6 bytes
PLA
LDX #14
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #14
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #14
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
TXA
PHA
LDX #8
@X:
NOP
DEX
BNE @X
PLA
TAX
PLA
Clobbers Z&N
PHA
PHP
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
NOP
PHP
PHA
SEC
LDA #8
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


76 cycles

5 bytes
LDX #15
@X:
DEX
BNE @X
Clobbers X, and Z&N
LDY #15
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHA
PHP
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
BIT $00
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PLA
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
PHA
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLP
Clobbers A, and S; and requires support for unofficial opcodes
PHA
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
Clobbers S, Z&N, and C; and requires support for unofficial opcodes
11 bytes
TYA
PHA
LDY #8
@Y:
LDA $00
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHA
PHP
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
NOP $00
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
NOP $00
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
12 bytes
NOP
PHA
TYA
PHA
LDY #11
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHP
SEC
LDA #6
@A:
NOP
NOP
NOP
SBC #1
BNE @A
PLP
Clobbers A
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #11
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


77 cycles

7 bytes
PHA
PHA
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
PHA
LDX #14
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
8 bytes
NOP
NOP
NOP
LDX #14
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
NOP
LDY #14
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
PLA
SEC
LDA #14
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
PHP
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X
10 bytes
NOP
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


78 cycles

6 bytes
LDX #11
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
LDY #11
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #15
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
LDA $00
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
13 bytes
PHP
PLP
PHP
PHA
SEC
LDA #136
@A = * - 1
; ^ Hides DEY
SBC #1
BMI @A
PLA
PLP
Clobbers nothing, requires nothing


79 cycles

6 bytes
PHA
LDY #15
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
PHA
LDX #15
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
7 bytes
LDA $00
LDY #15
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
LDA $00
LDX #15
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
BIT $00
LDY #15
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
BIT $00
LDX #15
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
STA @zptemp
LDY #15
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
STA @zptemp
LDX #15
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
NOP $00
LDY #15
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
NOP $00
LDX #15
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDY #15
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
JMP *+3
LDX #15
@X:
DEX
BNE @X
Clobbers X, and Z&N
9 bytes
PHA
PHA
PHP
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHA
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
NOP
PLA
SEC
LDA #14
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
10 bytes
NOP
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
NOP
PHP
LDY #13
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
NOP
PHP
LDX #13
@X:
DEX
BNE @X
PLP
Clobbers X
11 bytes
PHA
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


80 cycles

6 bytes
PLA
LDY #15
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
PLA
LDX #15
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
NOP
LDY #11
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #11
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
12 bytes
PHP
PHA
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


81 cycles

5 bytes
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #16
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHA
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
BIT $00
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PLA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
NOP
NOP
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHA
PHA
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
12 bytes
NOP
PHA
TYA
PHA
LDY #12
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
NOP
PHP
SEC
LDA #13
@A:
SBC #1
BNE @A
PLP
Clobbers A
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #12
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


82 cycles

6 bytes
LDY #9
@Y:
PLA
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
LDX #9
@X:
PLA
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
LDY #9
@Y:
NOP
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #9
@X:
NOP
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PLA
SEC
LDA #15
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
NOP
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y
10 bytes
NOP
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


83 cycles

6 bytes
NOP
LDX #16
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #15
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #15
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #16
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
PLP
Clobbers S; and requires support for unofficial opcodes
13 bytes
PHA
TYA
PHA
LDY #8
@Y:
LDA $00
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHA
PHP
PHA
SEC
LDA #9
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers S
NOP $00
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
14 bytes
PHP
PHA
SEC
LDA #6
@A:
NOP
NOP
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


84 cycles

6 bytes
PHA
LDX #16
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDA $00
LDX #16
@X:
DEX
BNE @X
Clobbers A, X, and Z&N
LDA $00
LDY #16
@Y:
DEY
BNE @Y
Clobbers A, Y, and Z&N
BIT $00
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, Z&N, and V
BIT $00
LDX #16
@X:
DEX
BNE @X
Clobbers X, Z&N, and V
STA @zptemp
LDX #16
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
STA @zptemp
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
NOP $00
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
NOP $00
LDX #16
@X:
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
8 bytes
JMP *+3
LDX #16
@X:
DEX
BNE @X
Clobbers X, and Z&N
JMP *+3
LDY #16
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
9 bytes
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHA
PHA
PHP
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHA
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
10 bytes
NOP
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
NOP
PHP
LDY #14
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
NOP
PHP
LDX #14
@X:
DEX
BNE @X
PLP
Clobbers X
11 bytes
PHA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


85 cycles

6 bytes
LDY #12
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #12
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHP
LDY #11
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #11
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #16
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #15
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
LDA $00
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


86 cycles

5 bytes
LDX #17
@X:
DEX
BNE @X
Clobbers X, and Z&N
LDY #17
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHA
PHP
LDY #15
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #15
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
NOP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
9 bytes
PHP
BIT $00
LDX #15
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
BIT $00
LDY #15
@Y:
DEY
BNE @Y
PLP
Clobbers Y
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PLA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
NOP
NOP
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
PHA
PHA
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
12 bytes
NOP
PHA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
NOP
PHP
SEC
LDA #14
@A:
SBC #1
BNE @A
PLP
Clobbers A
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


87 cycles

7 bytes
NOP
LDX #12
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #12
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
PHP
LDY #11
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #11
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
10 bytes
PHP
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


88 cycles

6 bytes
NOP
LDY #17
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #17
@X:
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
PHP
LDY #16
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #16
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #17
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #15
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
13 bytes
NOP
NOP
PHA
TYA
PHA
LDY #13
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHA
PHA
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
14 bytes
NOP
NOP
NOP
PHP
PHA
SEC
LDA #13
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


89 cycles

6 bytes
LDX #11
@X:
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
LDY #11
@Y:
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDX #11
@X:
LDA $00
DEX
BNE @X
Clobbers A, X, and Z&N
LDY #11
@Y:
LDA $00
DEY
BNE @Y
Clobbers A, Y, and Z&N
LDX #11
@X:
BIT $00
DEX
BNE @X
Clobbers X, Z&N, and V
LDY #11
@Y:
BIT $00
DEY
BNE @Y
Clobbers Y, Z&N, and V
LDY #11
@Y:
STA @zptemp
DEY
BNE @Y
Clobbers Y, and Z&N; and requires @zptemp
LDX #11
@X:
STA @zptemp
DEX
BNE @X
Clobbers X, and Z&N; and requires @zptemp
LDY #11
@Y:
NOP $00
DEY
BNE @Y
Clobbers Y, and Z&N; and requires support for unofficial opcodes
LDX #11
@X:
NOP $00
DEX
BNE @X
Clobbers X, and Z&N; and requires support for unofficial opcodes
8 bytes
LDX #11
@X:
JMP *+3
DEX
BNE @X
Clobbers X, and Z&N
LDY #11
@Y:
JMP *+3
DEY
BNE @Y
Clobbers Y, and Z&N
9 bytes
PHP
LDY #9
@Y:
NOP
NOP
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #9
@X:
NOP
NOP
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
TXA
PHA
LDX #11
@X:
NOP
DEX
BNE @X
PLA
TAX
Clobbers A, and Z&N
11 bytes
PHA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
PHP
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


90 cycles

6 bytes
PLA
LDX #17
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #17
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDX #17
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
NOP
LDY #17
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
NOP
PHP
LDY #16
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #16
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #17
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
LDA $00
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


91 cycles

5 bytes
LDY #18
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #18
@X:
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $48 ;hides 'PHA'
SBC #1
BMI @A
Clobbers A, S, Z&N, and C; and requires support for unofficial opcodes
8 bytes
PHA
PHP
LDX #16
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
PHP
LDY #16
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
SEC
LDA #11
@A:
PHA
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
BIT $00
LDX #16
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
BIT $00
LDY #16
@Y:
DEY
BNE @Y
PLP
Clobbers Y
LDA $00
SEC
LDA #17
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
10 bytes
PLA
TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, S, and Z&N
11 bytes
PHP
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
NOP
PHA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
13 bytes
NOP
NOP
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


92 cycles

6 bytes
LDY #13
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #13
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
8 bytes
PHP
LDX #12
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #12
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
PLA
SEC
LDA #17
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #16
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
10 bytes
NOP
PHP
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


93 cycles

6 bytes
NOP
LDX #18
@X:
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #18
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
7 bytes
PHP
LDX #17
@X:
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #18
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
NOP
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
NOP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
11 bytes
PHP
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
13 bytes
NOP
NOP
PHA
TYA
PHA
LDY #14
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
PHA
PHA
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
14 bytes
NOP
NOP
NOP
PHP
PHA
SEC
LDA #14
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


94 cycles

6 bytes
PHA
LDX #18
@X:
DEX
BNE @X
Clobbers X, S, and Z&N
PHA
LDY #18
@Y:
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
NOP
LDX #13
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
NOP
LDY #13
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
SEC
LDA #13
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
NOP
PHP
LDY #12
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #12
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
10 bytes
PHP
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHA
TYA
PHA
LDY #15
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
12 bytes
PHP
PHA
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


95 cycles

6 bytes
PLA
LDX #18
@X:
DEX
BNE @X
Clobbers A, X, S, and Z&N
PLA
LDY #18
@Y:
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
7 bytes
NOP
NOP
LDY #18
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
NOP
LDX #18
@X:
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
NOP
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #17
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #18
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
13 bytes
PHP
PHA
LDA $00
SEC
LDA #15
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


96 cycles

5 bytes
LDX #19
@X:
DEX
BNE @X
Clobbers X, and Z&N
LDY #19
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PHA
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP
Clobbers Y, and S
PHA
PHP
LDX #17
@X:
DEX
BNE @X
PLP
Clobbers X, and S
PHA
SEC
LDA #18
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
PHP
LDY #11
@Y:
BIT $00
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #11
@X:
BIT $00
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #13
@A:
NOP
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
TYA
PHA
LDY #12
@Y:
NOP
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
11 bytes
NOP
PHP
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #12
@A:
NOP
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
TXA
PHA
LDX #11
@X:
NOP
DEX
BNE @X
PLA
TAX
PLA
Clobbers Z&N
13 bytes
NOP
PHP
PHA
SEC
LDA #11
@A:
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


97 cycles

6 bytes
LDX #12
@X:
PHA
DEX
BNE @X
Clobbers X, S, and Z&N
LDY #12
@Y:
PHA
DEY
BNE @Y
Clobbers Y, S, and Z&N
7 bytes
LDX #8
@X:
PHP
PLP
DEX
BNE @X
Clobbers X, and Z&N
LDY #8
@Y:
PHP
PLP
DEY
BNE @Y
Clobbers Y, and Z&N
8 bytes
PLA
SEC
LDA #18
@A:
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
TYA
PHA
LDY #17
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
NOP
NOP
PHP
LDY #17
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
NOP
PHP
LDX #17
@X:
DEX
BNE @X
PLP
Clobbers X
10 bytes
NOP
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP
Clobbers A
NOP
PHA
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
11 bytes
PHP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


98 cycles

6 bytes
NOP
LDY #19
@Y:
DEY
BNE @Y
Clobbers Y, and Z&N
NOP
LDX #19
@X:
DEX
BNE @X
Clobbers X, and Z&N
7 bytes
PHP
LDY #18
@Y:
DEY
BNE @Y
PLP
Clobbers Y
PHP
LDX #18
@X:
DEX
BNE @X
PLP
Clobbers X
SEC
LDA #19
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
10 bytes
PHA
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP
Clobbers A, and S
PHA
PHA
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA
Clobbers S, Z&N, and C
11 bytes
PHP
SEC
LDA #11
@A:
BIT $00
SBC #1
BNE @A
PLP
Clobbers A
PHA
LDA $00
SEC
LDA #17
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
13 bytes
PHP
PHA
SEC
LDA #9
@A:
NOP
NOP
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


99 cycles

6 bytes
LDY #14
@Y:
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
LDX #14
@X:
NOP
DEX
BNE @X
Clobbers X, and Z&N
8 bytes
PHP
LDX #13
@X:
NOP
DEX
BNE @X
PLP
Clobbers X
PHP
LDY #13
@Y:
NOP
DEY
BNE @Y
PLP
Clobbers Y
SEC
LDA #12
@A:
PHA
SBC #1
BNE @A
Clobbers A, S, Z&N, and C
9 bytes
SEC
LDA #8
@A:
PHP
PLP
SBC #1
BNE @A
Clobbers A, Z&N, and C
PHP
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLP
Clobbers A; and requires support for unofficial opcodes
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA44 ;hides 'NOP zp'
SBC #1
BMI @A
PLA
Clobbers Z&N, and C; and requires support for unofficial opcodes
10 bytes
NOP
TYA
PHA
LDY #17
@Y:
DEY
BNE @Y
PLA
TAY
Clobbers A, and Z&N
11 bytes
PHA
TYA
PHA
LDY #16
@Y:
DEY
BNE @Y
PLA
TAY
PLA
Clobbers Z&N
NOP
NOP
PHP
SEC
LDA #17
@A:
SBC #1
BNE @A
PLP
Clobbers A
12 bytes
NOP
PHP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing


100 cycles

6 bytes
LDY #11
@Y:
PLA
DEY
BNE @Y
Clobbers A, Y, S, and Z&N
LDX #11
@X:
PLA
DEX
BNE @X
Clobbers A, X, S, and Z&N
7 bytes
LDX #11
@X:
NOP
NOP
DEX
BNE @X
Clobbers X, and Z&N
LDY #11
@Y:
NOP
NOP
DEY
BNE @Y
Clobbers Y, and Z&N
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EAEA ;hides two 'NOP's
SBC #1
BMI @A
Clobbers A, Z&N, and C; and requires support for unofficial opcodes
8 bytes
NOP
PHP
LDY #18
@Y:
DEY
BNE @Y
PLP
Clobbers Y
NOP
PHP
LDX #18
@X:
DEX
BNE @X
PLP
Clobbers X
NOP
SEC
LDA #19
@A:
SBC #1
BNE @A
Clobbers A, Z&N, and C
9 bytes
PHP
SEC
LDA #18
@A:
SBC #1
BNE @A
PLP
Clobbers A
PHA
SEC
LDA #18
@A:
SBC #1
BNE @A
PLA
Clobbers Z&N, and C
12 bytes
PHA
PHP
PHA
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers S
NOP
PHP
PHA
SEC
LDA #137
@A = * - 1
; ^ Hides !NOP #imm
NOP $EA,X ;hides 'NOP'
SBC #1
BMI @A
PLA
PLP
Requires support for unofficial opcodes
13 bytes
PHP
PHA
LDA $00
SEC
LDA #16
@A:
SBC #1
BNE @A
PLA
PLP
Clobbers nothing, requires nothing

More

Bisqwit's 6502 delay_n macro set for ca65: http://bisqwit.iki.fi/src/6502-inline_delay.7z