|
|
(9 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| | Shortest possible CPU code that creates N cycles of delay, depending on constraints. |
|
| |
|
| == Delay code == | | == Code == |
| | |
| Shortest possible CPU code that creates N cycles of delay, depending on constraints.
| |
|
| |
|
| All code samples are written for CA65. | | All code samples are written for CA65. |
Line 8: |
Line 7: |
| Assumptions: | | Assumptions: |
| * No page wrap occurs during any branch instruction. If a page wrap occurs, it adds +1 cycle for each loop, completely thwarting the accurate delay. | | * No page wrap occurs during any branch instruction. If a page wrap occurs, it adds +1 cycle for each loop, completely thwarting the accurate delay. |
| * No interrupt / NMI occurs during the delay code. Code samples where an interrupt could cause data corruption are separately indicated. | | * No interrupt / NMI occurs during the delay code. |
| | |
| It is possible to verify on compile time that no page wrap occurs,
| |
| by replacing all branches with these macros:
| |
| <pre>.macro branch_check opc, dest
| |
| opc dest
| |
| .assert >* = >(dest), warning, "branch_check: failed, crosses page"
| |
| .endmacro
| |
| .macro bccnw dest
| |
| branch_check bcc, dest
| |
| .endmacro
| |
| .macro bcsnw dest
| |
| branch_check bcs, dest
| |
| .endmacro
| |
| .macro beqnw dest
| |
| branch_check beq, dest
| |
| .endmacro
| |
| .macro bnenw dest
| |
| branch_check bne, dest
| |
| .endmacro
| |
| .macro bminw dest
| |
| branch_check bmi, dest
| |
| .endmacro
| |
| .macro bplnw dest
| |
| branch_check bpl, dest
| |
| .endmacro
| |
| .macro bvcnw dest
| |
| branch_check bvc, dest
| |
| .endmacro
| |
| .macro bvsnw dest
| |
| branch_check bvs, dest
| |
| .endmacro</pre>
| |
|
| |
|
| It is permissible for DMA to steal cycles during the loops. | | It is permissible for DMA to steal cycles during the loops. |
Line 46: |
Line 14: |
| in order to get the correct delay. | | in order to get the correct delay. |
|
| |
|
| Explanations on the requirements: | | === Explanations on the requirements === |
| * @zptemp means you have a zeropage address that you can write random data into.
| | |
| * @rti means you have a dummy interrupt handler installed that does nothing but <code>RTI</code>.
| |
| * @rts12 means you know a memory address that contains byte $60 (<code>RTS</code>). | | * @rts12 means you know a memory address that contains byte $60 (<code>RTS</code>). |
| * @rts14 means you know a memory address that contains a harmless 2-cycle instruction that fits your constraints (such as <code>CLC</code>, <code>LDA #0</code>, or <code>NOP</code>), followed by <code>RTS</code>.
| | cycle instruction that fits your constraints (such as <code>LDA $00</code>), followed by <code>RTS</code>. |
| * @rts15 means you know a memory address that contains a <code>JMP</code> that jumps to another location that contains <code>RTS</code>. Alternatively, it 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>. | | |
| * delay_a_25_clocks, delay_256a_16_clocks, delay_256a_x_33_clocks, delay_256a_x_31_clocks, and delay_256x_a_30_clocks are defined at [[Delay code]]. | | === Instructions, addressing modes, byte counts, cycle counts and notes === |
| * "Unsafe for interrupts" means that even though the S register is not clobbered, data corruption will occur if an interrupt/NMI happens in the middle of the delay code.
| | |
| | {| class="wikitable testtable" |
| | ! scope="col"| Addressing mode |
| | ! scope="col"| Instruction type |
| | ! scope="col"| Bytes |
| | ! scope="col"| Cycle count |
| | ! scope="col"| Example instruction |
| | ! scope="col"| Notes |
| | |- |
| | ! scope="row"| Implied |
| | ! scope="row"| Inter-register |
| | | 1 || 2 || <code>TAX</code> || <code>NOP</code> has no side effects. Flag-manipulations like <code>CLC</code>, and <code>SEC</code><code>CLV</code> are used when their effects are desired. |
| | |- |
| | ! scope="row"| Implied |
| | ! scope="row"| Stack push |
| | | 1 || 3 || <code>PHA</code> || <code>PHP</code> is only paired with <code>PLP</code>. |
| | |- |
| | ! scope="row"| Implied |
| | ! scope="row"| Stack pop |
| | | 1 || 4 || <code>PLA</code> || |
| | |- |
| | ! scope="row"| Implied |
| | ! scope="row"| Return |
| | | 1 || 6 || <code>RTS</code> || Used indirectly when paired with <code>JSR</code>. Similarly for <code>RTI</code>. |
| | |- |
| | ! scope="row"| Immediate |
| | ! scope="row"| |
| | | 2 || 2 || <code>CMP #$C5</code> || Includes instructions like <code>LDA</code>, <code>LDX</code> and <code>LDY</code>. Other ALU instructions are used in more complex situations. |
| | |- |
| | ! scope="row"| Relative |
| | ! scope="row"| Branch |
| | | 2 || 2—4 || <code>BCC *+2</code> || Branch takes 3 cycles when taken, 2 otherwise. A page crossing adds +1 cycle when branch is taken, but because of difficulties setting that up, we don't use it. |
| | |- |
| | ! scope="row"| Zeropage |
| | ! scope="row"| Read, write |
| | | 2 || 3 || <code>LDA $A5</code> |
| | |- |
| | ! scope="row"| Zeropage |
| | ! scope="row"| RMW |
| | | 2 || 5 || <code>INC @zptemp</code> || Writing to zeropage is only permitted when @zptemp is available. Technically we could save @zptemp into register and restore at end, but it is bytewise inferior to other techniques. |
| | |- |
| | ! scope="row"| Zeropage indexed |
| | ! scope="row"| Read, write |
| | | 2 || 4 || <code>LDA $EA,X</code> || Inferior to 2 × <code>NOP</code>, but useful for hiding additional code to be executed in a loop. |
| | |- |
| | ! scope="row"| Zeropage indexed |
| | ! scope="row"| RMW |
| | | 2 || 6 || <code>INC @zptemp,X</code> || Only doable when X is known to be 0, or when entire zeropage can be clobbered. |
| | |- |
| | ! scope="row"| Indexed indirect |
| | ! scope="row"| Read, write |
| | | 2 || 6 || <code>STA (@ptrtemp,X)</code> || Only doable when X is known to be 0. |
| | |- |
| | ! scope="row"| Indexed indirect |
| | ! scope="row"| RMW |
| | | 2 || 8 || <code>SLO (@ptrtemp,X)</code> || The most cost-effective instruction. Only doable when X is known to be 0, lest we write to a random address. All instructions in this category are unofficial. |
| | |- |
| | ! scope="row"| Indirect indexed |
| | ! scope="row"| Read |
| | | 2 || 5—6 || <code>LDA (@ptrtemp),Y</code> || Never used by this code. |
| | |- |
| | ! scope="row"| Indirect indexed |
| | ! scope="row"| Write |
| | | 2 || 6 || <code>STA (@ptrtemp),Y</code> || Only doable when Y is known to be 0. |
| | |- |
| | ! scope="row"| Indirect indexed |
| | ! scope="row"| RMW |
| | | 2 || 8 || <code>SLO (@ptrtemp),Y</code> || All instructions in this category are unofficial. |
| | |- |
| | ! scope="row"| Absolute |
| | ! scope="row"| Jump |
| | | 3 || 3 || <code>JMP *+3</code> || |
| | |- |
| | ! scope="row"| Absolute |
| | ! scope="row"| Read, write |
| | | 3 || 4 || <code>LDA $2808</code> || Inferior to 2 × <code>NOP</code>, but can be used carefully to hide additional code to be executed in a loop. |
| | |- |
| | ! scope="row"| Absolute |
| | ! scope="row"| RMW |
| | | 3 || 6 || <code>INC $4018</code> || Inferior to 3 × <code>NOP</code>. |
| | |- |
| | ! scope="row"| Absolute indexed |
| | ! scope="row"| Read |
| | | 3 || 4—5 || <code>LDA $0200,X</code> || Inferior to shorter alternatives. |
| | |- |
| | ! scope="row"| Absolute indexed |
| | ! scope="row"| Write |
| | | 3 || 5 || <code>STA $0200,X</code> || Inferior to shorter alternatives. |
| | |- |
| | ! scope="row"| Absolute indexed |
| | ! scope="row"| RMW |
| | | 3 || 7 || <code>INC $4018,X</code> || Only doable when writing into the given address is harmless considering the possible values of X. |
| | |- |
| | ! scope="row"| Absolute indirect |
| | ! scope="row"| Jump |
| | | 3 || 5 || <code>JMP (@ptrtemp)</code> || Inferior to shorter alternatives. |
| | |} |
|
| |
|
| {{#css: | | {{#css: |
Line 72: |
Line 135: |
| === 3 cycles === | | === 3 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|1 bytes
| |
| |-
| |
| |<pre>48 PHA</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|2 bytes | | !colspan="2"|2 bytes |
| |- | | |- |
Line 87: |
Line 146: |
| |- | | |- |
| |<pre>A4 A4 LDY $A4</pre>||Clobbers Y, and Z&N | | |<pre>A4 A4 LDY $A4</pre>||Clobbers Y, and Z&N |
| |-
| |
| |<pre>85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|3 bytes | | !colspan="2"|3 bytes |
| |- | | |- |
| |<pre>4C xx xx JMP *+3</pre>||Not relocatable code | | |<pre>4C xx xx JMP *+3</pre>||No requirements |
| |- | | |- |
| |} | | |} |
Line 102: |
Line 157: |
| === 4 cycles === | | === 4 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|1 bytes
| |
| |-
| |
| |<pre>68 PLA</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|2 bytes | | !colspan="2"|2 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 2</pre>||No requirements | | |<pre>EA ... NOP × 2</pre>||No requirements |
| |- | | |- |
| |} | | |} |
| * zp-indexed modes such as <code>LDA $00,X</code> also do 4 cycles, but having side effects, these two-byte instructions are inferior to a simple 2 × <code>NOP</code>. | | * zp-indexed modes such as <code>LDA $00,X</code> also do 4 cycles, but having side effects, these two-byte instructions are inferior to a simple 2 × <code>NOP</code>. |
| * There is also an unofficial opcode <code>NOP $00,X</code> (34 00), but there is no reason to use this instruction when the official equivalent has the same performance. | | * There is also an unofficial opcode <code>NOP $00,X</code> (34 00), but there is no reason to use this instruction when the official equivalent has the same performance. |
|
| |
|
Line 117: |
Line 168: |
| === 5 cycles === | | === 5 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|2 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|3 bytes | | !colspan="2"|3 bytes |
| |- | | |- |
Line 140: |
Line 184: |
| |<pre>EA NOP | | |<pre>EA NOP |
| A4 A4 LDY $A4</pre>||Clobbers Y, and Z&N | | A4 A4 LDY $A4</pre>||Clobbers Y, and Z&N |
| |-
| |
| |<pre>EA NOP
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|4 bytes | | !colspan="2"|4 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| 4C xx xx JMP *+3</pre>||Not relocatable code | | 4C xx xx JMP *+3</pre>||No requirements |
| |- | | |- |
| |} | | |} |
Line 158: |
Line 196: |
| === 6 cycles === | | === 6 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|2 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 ... PHA × 2</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|3 bytes | | !colspan="2"|3 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 3</pre>||No requirements | | |<pre>EA ... NOP × 3</pre>||No requirements |
| |- | | |- |
| |} | | |} |
Line 175: |
Line 204: |
| * ix instructions like <code>LDA ($00,X)</code> do 6 cycles, but the value of X decides where a pointer is read from, and said pointer can point anywhere. We only do that when the value of X is known. | | * ix instructions like <code>LDA ($00,X)</code> do 6 cycles, but the value of X decides where a pointer is read from, and said pointer can point anywhere. We only do that when the value of X is known. |
| * iy instructions like <code>LDA ($00),Y</code> also do 5-6 cycles, but in addition to the note above, we cannot predict whether a wrap occurs or not. So we don't use this mode. | | * iy instructions like <code>LDA ($00),Y</code> also do 5-6 cycles, but in addition to the note above, we cannot predict whether a wrap occurs or not. So we don't use this mode. |
| * Absolute RMW instructions like <code>INC $4018</code> do 6 cycles, but weighing 3 bytes with side-effects it would be inferior to 3 × <code>NOP</code>. | | * Absolute RMW instructions like <code>INC $4018</code> do 6 cycles, but weighing 3 bytes with side-effects it would be inferior to 3 × <code>NOP</code>. |
|
| |
|
|
| |
|
Line 183: |
Line 212: |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 28 PLP</pre>||Writes in stack | | 28 PLP</pre>||No requirements |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|3 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| E6 xx INC @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 2
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 2
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A6 A6 LDX $A6</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A4 A4 LDY $A4</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |- | | |- |
| |} | | |} |
Line 238: |
Line 222: |
| === 8 cycles === | | === 8 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|2 bytes
| |
| |-
| |
| |<pre>68 ... PLA × 2</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|3 bytes
| |
| |-
| |
| |<pre>BA TSX
| |
| 68 PLA
| |
| 9A TXS</pre>||Clobbers A, X, and Z&N; and unsafe for interrupts
| |
| |-
| |
| |<pre>EA NOP
| |
| F6 F6 INC $F6,X</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 2</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| |<pre>AA TAX
| |
| 68 PLA
| |
| 8C TXA</pre>||Clobbers X, S, and Z&N
| |
| |-
| |
| |<pre>A8 TAY
| |
| 68 PLA
| |
| 98 TYA</pre>||Clobbers Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|4 bytes | | !colspan="2"|4 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 4</pre>||No requirements | | |<pre>EA ... NOP × 4</pre>||No requirements |
| |- | | |- |
| |} | | |} |
Line 276: |
Line 236: |
| |<pre>EA NOP | | |<pre>EA NOP |
| 08 PHP | | 08 PHP |
| 28 PLP</pre>||Writes in stack | | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>EA NOP
| | |} |
| 68 PLA
| |
| 48 PHA</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>A2 AE LDX #$AE ;hides 'LDX $FDD0'
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 AC LDY #$AC ;hides 'LDY $FDD0'
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| E6 xx INC @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 3
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 3
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |} | |
| * Jumping into the middle of another instruction and thereby reusing code is a very efficient way of reducing code size. Note that all code samples using branches on this page require that no page wrap occurs. | | * Jumping into the middle of another instruction and thereby reusing code is a very efficient way of reducing code size. Note that all code samples using branches on this page require that no page wrap occurs. |
|
| |
|
Line 336: |
Line 244: |
| === 10 cycles === | | === 10 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 ... PLA × 2</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|4 bytes | | !colspan="2"|4 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| C5 C5 CMP $C5 | | C5 C5 CMP $C5 |
| 28 PLP</pre>||Writes in stack | | 28 PLP</pre>||No requirements |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 5</pre>||No requirements
| |
| |- | | |- |
| |} | | |} |
Line 364: |
Line 256: |
| === 11 cycles === | | === 11 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| 48 PHA</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|4 bytes | | !colspan="2"|4 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA ... NOP × 2 |
| 08 PHP | | 08 PHP |
| 28 PLP</pre>||Writes in stack | | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |} |
| 68 PLA
| | |
| 48 PHA</pre>||Clobbers A, and Z&N
| | |
| | === 12 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|3 bytes |
| |- | | |- |
| |<pre>AA TAX | | |<pre>20 xx xx JSR @rts12</pre>||Requires @rts12 |
| 68 PLA
| |
| 48 PHA
| |
| 8C TXA</pre>||Clobbers X, and Z&N
| |
| |- | | |- |
| |<pre>A8 TAY | | !colspan="2"|4 bytes |
| 68 PLA
| |
| 48 PHA
| |
| 98 TYA</pre>||Clobbers Y, and Z&N
| |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>36 36 ROL $36,X |
| F6 F6 INC $F6,X</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| | 76 36 ROR $36,X</pre>||Clobbers Z&N |
| |- | | |- |
| !colspan="2"|5 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>08 PHP |
| EA ... NOP × 3</pre>||Clobbers Z&N; and requires @zptemp
| | 18 CLC |
| | 90 00 BCC *+2 |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |} |
| FE 00 02 INC $0200,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| | * <code>JSR-RTS</code> causes 12 cycles of delay. But it does write a function return address in the stack, which may be unwanted in some applications. S is not modified. |
| | * Again, <code>ROL-ROR</code> does not have side effects (as long as an interrupt does not happen in the middle), except for Z+N. |
| | |
| | |
| | === 13 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA ... NOP × 3 |
| FE 00 03 INC $0300,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| | 08 PHP |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |} |
| FE 00 04 INC $0400,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| | |
| |-
| | |
| |<pre>EA ... NOP × 2
| | === 14 cycles === |
| FE 00 05 INC $0500,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| | {| class="wikitable testtable" |
| |-
| | !colspan="2"|4 bytes |
| |<pre>EA ... NOP × 2
| |
| FE 00 06 INC $0600,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 07 INC $0700,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 4
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 4
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 4
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 4
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|7 bytes | |
| |- | | |- |
| |<pre>EA ... NOP × 4 | | |<pre>08 PHP \ × 2 |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 12 cycles === | | === 15 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>20 xx xx JSR @rts12</pre>||Requires @rts12; and writes in stack | | |<pre>08 PHP |
| | BA TSX |
| | 28 PLP |
| | 9A TXS |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>68 ... PLA × 3</pre>||Clobbers A, S, and Z&N | | |<pre>C5 C5 CMP $C5 |
| | 20 xx xx JSR @rts12</pre>||Clobbers Z&N, and C; and requires @rts12 |
| |- | | |- |
| !colspan="2"|4 bytes
| | |<pre>24 24 BIT $24 |
| | 20 xx xx JSR @rts12</pre>||Clobbers Z&N, and V; and requires @rts12 |
| |- | | |- |
| |<pre>36 36 ROL $36,X | | |<pre>A5 A5 LDA $A5 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N
| | 20 xx xx JSR @rts12</pre>||Clobbers A, and Z&N; and requires @rts12 |
| |- | | |- |
| |<pre>08 PHP | | |<pre>A4 A4 LDY $A4 |
| E6 xx INC @zptemp
| | 20 xx xx JSR @rts12</pre>||Clobbers Y, and Z&N; and requires @rts12 |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |- | | |- |
| |<pre>48 ... PHA × 4</pre>||Clobbers S; and writes in stack
| | !colspan="2"|6 bytes |
| |-
| |
| !colspan="2"|5 bytes | |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 18 CLC
| | 28 PLP |
| 90 00 BCC *+2
| | EA ... NOP × 4</pre>||No requirements |
| 28 PLP</pre>||Writes in stack | |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 6</pre>||No requirements
| |
| |- | | |- |
| |} | | |} |
| * <code>JSR-RTS</code> causes 12 cycles of delay. But it does write a function return address in the stack, which may be unwanted in some applications. S is not modified.
| |
| * Again, <code>ROL-ROR</code> does not have side effects (as long as an interrupt does not happen in the middle), except for Z+N.
| |
|
| |
|
|
| |
|
| === 13 cycles === | | === 16 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|2 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack | | |<pre>EA NOP |
| | 08 PHP \ × 2 |
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| !colspan="2"|4 bytes | | |} |
| | |
| | |
| | === 17 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| F6 F6 INC $F6,X
| | 48 PHA |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| | A5 A5 LDA $A5 |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 68 PLA | | 68 PLA |
| 48 PHA</pre>||Clobbers A, and Z&N; and requires @zptemp, and writable $00-$FF
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |} |
| 08 PHP
| | |
| 28 PLP</pre>||Clobbers S; and writes in stack
| | |
| | === 18 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA ... NOP × 2 |
| 68 ... PLA × 2
| | 08 PHP \ × 2 |
| 48 PHA</pre>||Clobbers A, S, and Z&N
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| | |} |
| | |
| | |
| | === 19 cycles === |
| | {| class="wikitable testtable" |
| !colspan="2"|5 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>08 PHP |
| 08 PHP | | 28 PLP |
| 28 PLP</pre>||Writes in stack | | 20 xx xx JSR @rts12</pre>||Requires @rts12 |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 68 PLA
| |
| 48 PHA</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| AA TAX
| |
| 68 PLA
| |
| 48 PHA
| |
| 8C TXA</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A8 TAY
| |
| 68 PLA
| |
| 48 PHA
| |
| 98 TYA</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| E6 xx INC @zptemp
| |
| F6 F6 INC $F6,X</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |- | | |- |
| !colspan="2"|6 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | |<pre>08 PHP |
| 26 26 ROL $26
| | 36 36 ROL $36,X |
| 66 26 ROR $26</pre>||Clobbers Z&N, and C
| | 76 36 ROR $36,X |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |} |
| 26 26 ROL $26
| | |
| 66 26 ROR $26</pre>||Clobbers Z&N, and V
| | |
| | === 20 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>85 xx STA @zptemp | | |<pre>A9 2A LDA #$2A ;hides 'ROL A' |
| 26 26 ROL $26
| | 38 SEC |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires @zptemp
| | 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | !colspan="2"|7 bytes |
| FE 00 02 INC $0200,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>EA ... NOP × 3 |
| FE 00 03 INC $0300,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| | 08 PHP \ × 2 |
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |} |
| FE 00 04 INC $0400,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| | |
| | |
| | === 21 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>18 CLC |
| FE 00 05 INC $0500,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C |
| | |- |
| | |<pre>A2 04 LDX #4 |
| | CA DEX |
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| | |- |
| | |<pre>A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | !colspan="2"|6 bytes |
| FE 00 06 INC $0600,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>08 PHP \ × 3 |
| FE 00 07 INC $0700,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |<pre>04 04 NOP $04 | | |} |
| 26 26 ROL $26
| | |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| | |
| | === 22 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| !colspan="2"|7 bytes
| | |<pre>18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 38 SEC |
| | 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>18 ... CLC × 5 | | |<pre>A2 02 LDX #2 |
| 90 00 BCC *+2</pre>||Clobbers C
| | EA NOP |
| | CA DEX |
| | 10 FC BPL *-2</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>B8 ... CLV × 5 | | |<pre>A0 03 LDY #3 |
| 50 00 BVC *+2</pre>||Clobbers V
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>4C xx xx JMP *+3 | | !colspan="2"|7 bytes |
| 26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N; and not relocatable code
| |
| |- | | |- |
| |<pre>EA ... NOP × 5 | | |<pre>08 PHP |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| | BA TSX |
| | 08 PHP |
| | 28 ... PLP × 2 |
| | 9A TXS |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA ... NOP × 5 | | |<pre>08 PHP |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| | C5 C5 CMP $C5 |
| | 28 PLP |
| | 20 xx xx JSR @rts12</pre>||Requires @rts12 |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 5 | | |<pre>08 PHP \ × 2 |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| | 28 PLP / |
| | EA ... NOP × 4</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 14 cycles === | | === 23 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack | | |<pre>18 ... CLC × 2 |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| !colspan="2"|4 bytes
| | |<pre>EA NOP |
| |-
| | A2 04 LDX #4 |
| |<pre>08 PHP \ × 2 | | CA DEX |
| 28 PLP /</pre>||Writes in stack
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |-
| |
| |<pre>68 PLA \ × 2
| |
| 48 PHA /</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| 36 36 ROL $36,X
| | A0 04 LDY #4 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| !colspan="2"|7 bytes | | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 7</pre>||No requirements | | |<pre>EA NOP |
| | 08 PHP \ × 3 |
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 15 cycles === | | === 24 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes | | !colspan="2"|4 bytes |
| | |- |
| | |<pre>A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>20 xx xx JSR @rts15</pre>||Requires @rts12, and @rts15; and writes in stack | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>20 xx xx JSR @rts12× 2</pre>||Requires @rts12 |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |- | | |- |
| !colspan="2"|4 bytes | | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>68 PLA | | |<pre>A6 A6 LDX $A6 |
| 48 PHA
| | A2 04 LDX #4 |
| 68 ... PLA × 2</pre>||Clobbers A, S, and Z&N
| | CA DEX |
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>48 PHA | | |<pre>A4 A4 LDY $A4 |
| 20 xx xx JSR @rts12</pre>||Clobbers S; requires @rts12; and writes in stack
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| !colspan="2"|5 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| BA TSX
| | C5 C5 CMP $C5 |
| 28 PLP | | 28 PLP \ × 2 |
| 9A TXS
| | 08 PHP / |
| 28 PLP</pre>||Clobbers X; and writes in stack | | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>68 PLA | | |} |
| 48 PHA
| | |
| BA TSX
| | |
| 68 PLA
| | === 25 cycles === |
| 9A TXS</pre>||Clobbers A, X, and Z&N; and unsafe for interrupts
| | {| class="wikitable testtable" |
| | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>98 TYA |
| 08 PHP
| | A0 04 LDY #4 |
| F6 F6 INC $F6,X
| | 88 DEY |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| | D0 FD BNE *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA ... NOP × 2 |
| F6 F6 INC $F6,X
| | A2 04 LDX #4 |
| 68 PLA
| | CA DEX |
| 48 PHA</pre>||Clobbers A, and Z&N; and requires @zptemp, and writable $00-$FF
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | |<pre>EA ... NOP × 2 |
| 20 xx xx JSR @rts12</pre>||Clobbers Z&N, and C; requires @rts12; and writes in stack
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>24 24 BIT $24 | | !colspan="2"|8 bytes |
| 20 xx xx JSR @rts12</pre>||Clobbers Z&N, and V; requires @rts12; and writes in stack
| |
| |- | | |- |
| |<pre>A5 A5 LDA $A5 | | |<pre>EA ... NOP × 2 |
| 20 xx xx JSR @rts12</pre>||Clobbers A, and Z&N; requires @rts12; and writes in stack
| | 08 PHP \ × 3 |
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |<pre>A4 A4 LDY $A4 | | |} |
| 20 xx xx JSR @rts12</pre>||Clobbers Y, and Z&N; requires @rts12; and writes in stack
| | |
| | |
| | === 26 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>85 xx STA @zptemp | | |<pre>18 CLC |
| 20 xx xx JSR @rts12</pre>||Requires @zptemp, and @rts12; and writes in stack
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>04 04 NOP $04 | | |<pre>A2 04 LDX #4 |
| 20 xx xx JSR @rts12</pre>||Requires @rts12, and support for unofficial opcodes; and writes in stack
| | CA DEX |
| |- | | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |<pre>48 ... PHA × 5</pre>||Clobbers S; and writes in stack | | |- |
| | |<pre>A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>AA TAX
| | !colspan="2"|7 bytes |
| 68 ... PLA × 2
| |
| 48 PHA
| |
| 8C TXA</pre>||Clobbers X, S, and Z&N
| |
| |- | | |- |
| |<pre>A8 TAY | | |<pre>EA NOP |
| 68 ... PLA × 2
| | 20 xx xx JSR @rts12× 2</pre>||Requires @rts12 |
| 48 PHA
| |
| 98 TYA</pre>||Clobbers Y, S, and Z&N
| |
| |- | | |- |
| !colspan="2"|6 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 28 PLP
| | 48 PHA |
| EA ... NOP × 4</pre>||Writes in stack
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X | | 36 36 ROL $36,X |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and C | | 76 36 ROR $36,X |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |} |
| 36 36 ROL $36,X
| | |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and V
| | |
| | === 27 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>A5 A5 LDA $A5 | | |<pre>A5 A5 LDA $A5 |
| 36 36 ROL $36,X
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 76 36 ROR $36,X</pre>||Clobbers A, and Z&N
| | 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|7 bytes | | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>4C xx xx JMP *+3 | | |<pre>48 PHA |
| 36 36 ROL $36,X
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and not relocatable code
| | 38 SEC |
| | 10 FC BPL *-2 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>FE 00 02 INC $0200,X | | |<pre>08 PHP |
| EA ... NOP × 4</pre>||Clobbers Z&N; and requires writable $200-$2FF
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 38 SEC |
| | 10 FC BPL *-2 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>FE 00 03 INC $0300,X | | |<pre>24 2C BIT <$2C ;hides 'BIT $FDA2' |
| EA ... NOP × 4</pre>||Clobbers Z&N; and requires writable $300-$3FF
| | A2 FD LDX #253 |
| | E8 INX |
| | D0 FA BNE *-4</pre>||Clobbers X, Z&N, and V |
| |- | | |- |
| |<pre>FE 00 04 INC $0400,X | | |<pre>24 2C BIT <$2C ;hides 'BIT $FDA0' |
| EA ... NOP × 4</pre>||Clobbers Z&N; and requires writable $400-$4FF
| | A0 FD LDY #253 |
| | C8 INY |
| | D0 FA BNE *-4</pre>||Clobbers Y, Z&N, and V |
| |- | | |- |
| |<pre>FE 00 05 INC $0500,X | | |<pre>A4 AC LDY <$AC ;hides 'LDY $82A2' |
| EA ... NOP × 4</pre>||Clobbers Z&N; and requires writable $500-$5FF
| | A2 82 LDX #130 |
| |-
| | CA DEX |
| |<pre>FE 00 06 INC $0600,X
| | 30 FA BMI *-4</pre>||Clobbers X, Y, and Z&N |
| EA ... NOP × 4</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| EA ... NOP × 4</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>18 ... CLC × 6 | | |<pre>EA ... NOP × 3 |
| 90 00 BCC *+2</pre>||Clobbers C
| | A2 04 LDX #4 |
| | CA DEX |
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>B8 ... CLV × 6 | | |<pre>EA ... NOP × 3 |
| 50 00 BVC *+2</pre>||Clobbers V
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 6 | | |<pre>24 24 BIT $24 |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| | 20 xx xx JSR @rts12× 2</pre>||Clobbers Z&N, and V; and requires @rts12 |
| |- | | |- |
| |<pre>EA ... NOP × 6 | | |<pre>20 xx xx JSR @rts12 |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| | 08 PHP |
| | BA TSX |
| | 28 PLP |
| | 9A TXS |
| | 28 PLP</pre>||Clobbers X; and requires @rts12 |
| |- | | |- |
| !colspan="2"|9 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 6 | | |<pre>EA ... NOP × 3 |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| | 08 PHP \ × 3 |
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 16 cycles === | | === 28 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>48 PHA | | |<pre>38 ... SEC × 2 |
| 00 00 BRK 0</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| !colspan="2"|4 bytes
| | |<pre>EA NOP |
| | A2 04 LDX #4 |
| | CA DEX |
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | !colspan="2"|7 bytes |
| 00 00 BRK 0</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |<pre>48 PHA |
| 00 00 BRK 0</pre>||Clobbers Z&N, and V; requires dummy interrupt handler; and writes in stack
| | 18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 90 FD BCC *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>A5 A5 LDA $A5 | | |<pre>08 PHP |
| 00 00 BRK 0</pre>||Clobbers A, and Z&N; requires dummy interrupt handler; and writes in stack
| | 18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 90 FD BCC *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>A6 A6 LDX $A6 | | |<pre>08 PHP |
| 00 00 BRK 0</pre>||Clobbers X, and Z&N; requires dummy interrupt handler; and writes in stack
| | A2 04 LDX #4 |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| 00 00 BRK 0</pre>||Clobbers Y, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 00 00 BRK 0</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 4</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP \ × 2 | |
| 28 PLP /</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA \ × 2
| |
| 48 PHA /</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>A2 03 LDX #3
| |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N | | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>A0 02 LDY #2 | | |<pre>08 PHP |
| | A0 04 LDY #4 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| | D0 FD BNE *-1 |
| |-
| | 28 PLP</pre>||Clobbers Y |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N
| |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 8</pre>||No requirements | | |<pre>08 PHP \ × 4 |
| | 28 PLP /</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 17 cycles === | | === 29 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|3 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>68 PLA | | |<pre>18 CLC |
| 00 00 BRK 0</pre>||Clobbers A, S, and Z&N; requires dummy interrupt handler; and writes in stack
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | EA NOP |
| | 90 FC BCC *-2</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| !colspan="2"|4 bytes
| | |<pre>A2 04 LDX #4 |
| | EA NOP |
| | CA DEX |
| | D0 FC BNE *-2</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A0 04 LDY #4 |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, and @rts15; and writes in stack
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 2
| | !colspan="2"|8 bytes |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |- | | |- |
| |<pre>48 PHA | | |<pre>48 PHA |
| 20 xx xx JSR @rts14</pre>||Clobbers S; requires @rts12, and @rts14; and writes in stack
| | 18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 38 SEC |
| | 10 FC BPL *-2 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| !colspan="2"|5 bytes
| | |<pre>08 PHP |
| | 18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 38 SEC |
| | 10 FC BPL *-2 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>08 PHP |
| 20 xx xx JSR @rts12</pre>||Clobbers Z&N; requires @zptemp, and @rts12; and writes in stack
| | A2 02 LDX #2 |
| | EA NOP |
| | CA DEX |
| | 10 FC BPL *-2 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | |<pre>08 PHP |
| 20 xx xx JSR @rts14</pre>||Clobbers Z&N, and C; requires @rts12, and @rts14; and writes in stack
| | A0 03 LDY #3 |
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>24 24 BIT $24 | | !colspan="2"|9 bytes |
| 20 xx xx JSR @rts14</pre>||Clobbers Z&N, and V; requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>A5 A5 LDA $A5 | | |<pre>08 PHP |
| 20 xx xx JSR @rts14</pre>||Clobbers A, and Z&N; requires @rts12, and @rts14; and writes in stack | | 28 PLP |
| | 08 PHP |
| | C5 C5 CMP $C5 |
| | 28 PLP |
| | 20 xx xx JSR @rts12</pre>||Requires @rts12 |
| |- | | |- |
| |<pre>A6 A6 LDX $A6 | | !colspan="2"|10 bytes |
| 20 xx xx JSR @rts14</pre>||Clobbers X, and Z&N; requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>A4 A4 LDY $A4 | | |<pre>08 PHP |
| 20 xx xx JSR @rts14</pre>||Clobbers Y, and Z&N; requires @rts12, and @rts14; and writes in stack
| | C5 C5 CMP $C5 |
| | 28 PLP |
| | 08 PHP |
| | 36 36 ROL $36,X |
| | 76 36 ROR $36,X |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>85 xx STA @zptemp | | |} |
| 20 xx xx JSR @rts14</pre>||Requires @zptemp, @rts12, and @rts14; and writes in stack
| | |
| | |
| | === 30 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>04 04 NOP $04 | | |<pre>98 TYA |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, @rts14, and support for unofficial opcodes; and writes in stack
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>48 PHA | | |<pre>EA ... NOP × 2 |
| 08 PHP \ × 2
| | A2 04 LDX #4 |
| 28 PLP /</pre>||Clobbers S; and writes in stack
| | CA DEX |
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| | |- |
| | |<pre>EA ... NOP × 2 |
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA NOP
| | !colspan="2"|8 bytes |
| 68 PLA
| |
| 48 PHA
| |
| 68 ... PLA × 2</pre>||Clobbers A, S, and Z&N
| |
| |- | | |- |
| !colspan="2"|6 bytes
| | |<pre>48 PHA |
| | 18 ... CLC × 2 |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 90 FD BCC *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 26 26 ROL $26
| | 18 ... CLC × 2 |
| 66 26 ROR $26
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 28 PLP</pre>||Writes in stack | | 90 FD BCC *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>68 PLA | | |<pre>EA NOP |
| 48 PHA
| | 08 PHP |
| 26 26 ROL $26
| | A2 04 LDX #4 |
| 66 26 ROR $26</pre>||Clobbers A, and Z&N
| | CA DEX |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>EA NOP |
| 36 36 ROL $36,X
| | 08 PHP |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires @zptemp
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>AA TAX
| | !colspan="2"|9 bytes |
| EA NOP
| |
| 68 ... PLA × 2
| |
| 48 PHA
| |
| 8C TXA</pre>||Clobbers X, S, and Z&N
| |
| |- | | |- |
| |<pre>A8 TAY | | |<pre>08 PHP |
| EA NOP
| |
| 68 ... PLA × 2
| |
| 48 PHA | | 48 PHA |
| 98 TYA</pre>||Clobbers Y, S, and Z&N
| | 18 CLC |
| | A9 6A LDA #$6A ;hides 'ROR A' |
| | 90 FD BCC *-1 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| !colspan="2"|7 bytes | | |} |
| | |
| | |
| | === 31 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>18 CLC |
| C5 C5 CMP $C5
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 36 36 ROL $36,X
| | 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and C
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A2 05 LDX #5 |
| 24 24 BIT $24
| | CA DEX |
| 36 36 ROL $36,X
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and V
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A0 06 LDY #6 |
| A6 A6 LDX $A6
| | 88 DEY |
| 36 36 ROL $36,X
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| 76 36 ROR $36,X</pre>||Clobbers X, and Z&N
| |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|6 bytes |
| A4 A4 LDY $A4
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Y, and Z&N
| |
| |- | | |- |
| |<pre>FE 00 02 INC $0200,X | | |<pre>48 PHA |
| 26 26 ROL $26
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires writable $200-$2FF
| | 10 FD BPL *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>FE 00 03 INC $0300,X | | |<pre>08 PHP |
| 26 26 ROL $26
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires writable $300-$3FF
| | 10 FD BPL *-1 |
| |-
| | 28 PLP</pre>||Clobbers A |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| 4C xx xx JMP *+3
| | 28 PLP |
| 36 36 ROL $36,X
| | 20 xx xx JSR @rts12× 2</pre>||Requires @rts12 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and not relocatable code
| |
| |- | | |- |
| !colspan="2"|9 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>18 ... CLC × 7 | | |<pre>08 PHP |
| 90 00 BCC *+2</pre>||Clobbers C
| | A6 A6 LDX $A6 |
| | A2 04 LDX #4 |
| | CA DEX |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>B8 ... CLV × 7 | | |<pre>08 PHP |
| 50 00 BVC *+2</pre>||Clobbers V
| | A4 A4 LDY $A4 |
| |-
| | A0 04 LDY #4 |
| |<pre>EA ... NOP × 7
| | 88 DEY |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| | D0 FD BNE *-1 |
| |-
| | 28 PLP</pre>||Clobbers Y |
| |<pre>EA ... NOP × 7
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|10 bytes | | !colspan="2"|10 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 7 | | |<pre>08 PHP |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| | 36 36 ROL $36,X \ × 2 |
| | 76 36 ROR $36,X / |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 18 cycles === | | === 32 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|4 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>A2 05 LDX #5 ;hides 'ORA zp' |
| 00 00 BRK 0</pre>||Clobbers Z&N; requires @zptemp, and dummy interrupt handler; and writes in stack
| | CA DEX ;first loop only |
| | CA DEX |
| | D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N |
| |- | | |- |
| |<pre>48 PHA | | |<pre>A0 05 LDY #5 ;hides 'ORA zp' |
| 20 xx xx JSR @rts15</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| | 88 DEY ;first loop only |
| | 88 DEY |
| | D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N |
| |- | | |- |
| |<pre>68 PLA | | !colspan="2"|7 bytes |
| 20 xx xx JSR @rts14</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A9 2A LDA #$2A ;hides 'ROL A' |
| 48 PHA
| | EA ... NOP × 3 |
| 00 00 BRK 0</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| | 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| !colspan="2"|5 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>F6 F6 INC $F6,X | | |<pre>EA NOP |
| 20 xx xx JSR @rts12</pre>||Clobbers Z&N; requires @zptemp, @rts12, and writable $00-$FF; and writes in stack
| | 98 TYA |
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>A6 A6 LDX $A6 |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| | A2 04 LDX #4 |
| |-
| | EA NOP |
| |<pre>C5 C5 CMP $C5
| | CA DEX |
| 20 xx xx JSR @rts15</pre>||Clobbers Z&N, and C; requires @rts12, and @rts15; and writes in stack
| | D0 FC BNE *-2</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |<pre>A4 A4 LDY $A4 |
| 20 xx xx JSR @rts15</pre>||Clobbers Z&N, and V; requires @rts12, and @rts15; and writes in stack
| | A0 04 LDY #4 |
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>A5 A5 LDA $A5 | | !colspan="2"|9 bytes |
| 20 xx xx JSR @rts15</pre>||Clobbers A, and Z&N; requires @rts12, and @rts15; and writes in stack
| |
| |- | | |- |
| |<pre>A6 A6 LDX $A6 | | |<pre>48 PHA |
| 20 xx xx JSR @rts15</pre>||Clobbers X, and Z&N; requires @rts12, and @rts15; and writes in stack
| | 98 TYA |
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| |<pre>A4 A4 LDY $A4 | | |<pre>08 PHP |
| 20 xx xx JSR @rts15</pre>||Clobbers Y, and Z&N; requires @rts12, and @rts15; and writes in stack
| | 98 TYA |
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>85 xx STA @zptemp | | |<pre>EA ... NOP × 2 |
| 20 xx xx JSR @rts15</pre>||Requires @zptemp, @rts12, and @rts15; and writes in stack
| | 08 PHP |
| | A2 04 LDX #4 |
| | CA DEX |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>A9 00 LDA #0 | | |<pre>EA ... NOP × 2 |
| 20 xx xx JSR delay_256a_16_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks, and delay_256a_16_clocks; and writes in stack
| | 08 PHP |
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>04 04 NOP $04 | | !colspan="2"|10 bytes |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, @rts15, and support for unofficial opcodes; and writes in stack
| |
| |- | | |- |
| |<pre>18 CLC | | |<pre>08 PHP |
| 90 00 BCC *+2 | | 48 PHA |
| 00 00 BRK 0</pre>||Clobbers C; requires dummy interrupt handler; and writes in stack
| | 18 ... CLC × 2 |
| | A9 6A LDA #$6A ;hides 'ROR A' |
| | 90 FD BCC *-1 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>B8 CLV | | |} |
| 50 00 BVC *+2
| | |
| 00 00 BRK 0</pre>||Clobbers V; requires dummy interrupt handler; and writes in stack
| | |
| | === 33 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>18 ... CLC × 2 |
| A5 A5 LDA $A5
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 00 00 BRK 0</pre>||Clobbers A, and Z&N; requires dummy interrupt handler; and writes in stack
| | 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| A6 A6 LDX $A6
| | A2 05 LDX #5 |
| 00 00 BRK 0</pre>||Clobbers X, and Z&N; requires dummy interrupt handler; and writes in stack
| | CA DEX |
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| A4 A4 LDY $A4
| | A0 06 LDY #6 |
| 00 00 BRK 0</pre>||Clobbers Y, and Z&N; requires dummy interrupt handler; and writes in stack
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|7 bytes |
| 85 xx STA @zptemp
| |
| 00 00 BRK 0</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>48 PHA |
| 04 04 NOP $04
| | 18 CLC |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| 68 ... PLA × 4</pre>||Clobbers A, S, and Z&N
| | 18 CLC |
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>08 PHP |
| 20 xx xx JSR @rts12</pre>||Clobbers S; requires @rts12; and writes in stack
| | A2 04 LDX #4 |
| | CA DEX |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| !colspan="2"|6 bytes
| | |<pre>08 PHP |
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>EA ... NOP × 2
| | !colspan="2"|9 bytes |
| 08 PHP \ × 2
| |
| 28 PLP /</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 68 PLA \ × 2
| |
| 48 PHA /</pre>||Clobbers A, and Z&N
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| A2 03 LDX #3
| | 08 PHP |
| CA DEX
| | 28 PLP |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| | 20 xx xx JSR @rts12× 2</pre>||Requires @rts12 |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|10 bytes |
| A0 02 LDY #2
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N | |
| |- | | |- |
| |<pre>F6 F6... INC $F6,X× 3</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF | | |<pre>08 PHP \ × 2 |
| |-
| | 28 PLP / |
| !colspan="2"|7 bytes
| | 08 PHP |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X | | 36 36 ROL $36,X |
| 76 36 ROR $36,X</pre>||Clobbers Z&N | | 76 36 ROR $36,X |
| |-
| | 28 PLP</pre>||No requirements |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 9</pre>||No requirements
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 19 cycles === | | === 34 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|4 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>F6 F6 INC $F6,X | | |<pre>A9 0A LDA #$0A ;hides 'ASL A' |
| 00 00 BRK 0</pre>||Clobbers Z&N; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| | 18 CLC |
| | 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>68 PLA | | |<pre>A0 88 LDY #136 ;hides 'DEY' |
| 20 xx xx JSR @rts15</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts15; and writes in stack
| | 88 DEY |
| | 30 FC BMI *-2</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>48 ... PHA × 2
| | !colspan="2"|7 bytes |
| 00 00 BRK 0</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |- | | |- |
| !colspan="2"|5 bytes
| | |<pre>A6 A6 LDX $A6 |
| | A2 05 LDX #5 |
| | CA DEX |
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>08 PHP | | !colspan="2"|8 bytes |
| 28 PLP
| |
| 20 xx xx JSR @rts12</pre>||Requires @rts12; and writes in stack
| |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>C5 C5 CMP $C5 |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA | | 48 PHA |
| 68 ... PLA × 3</pre>||Clobbers A, S, and Z&N | | A9 0A LDA #$0A ;hides 'ASL A' |
| |-
| | 10 FD BPL *-1 |
| !colspan="2"|6 bytes
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 36 36 ROL $36,X
| | A5 A5 LDA $A5 |
| 76 36 ROR $36,X
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 28 PLP</pre>||Writes in stack | | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>68 PLA | | !colspan="2"|9 bytes |
| 48 PHA
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers A, and Z&N
| |
| |- | | |- |
| |<pre>AA TAX | | |<pre>08 PHP |
| 68 PLA
| |
| 48 PHA | | 48 PHA |
| 68 ... PLA × 2
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 8C TXA</pre>||Clobbers X, S, and Z&N
| | 38 SEC |
| |-
| | 10 FC BPL *-2 |
| |<pre>A8 TAY
| |
| 68 PLA | | 68 PLA |
| 48 PHA
| | 28 PLP</pre>||No requirements |
| 68 ... PLA × 2
| |
| 98 TYA</pre>||Clobbers Y, S, and Z&N
| |
| |- | | |- |
| !colspan="2"|7 bytes | | |} |
| | |
| | |
| | === 35 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>A6 A6 LDX $A6 | | |<pre>A9 2A LDA #$2A ;hides 'ROL A' |
| A2 03 LDX #3
| | 08 PHP |
| CA DEX
| | 28 PLP |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| | 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>A4 A4 LDY $A4 | | |<pre>A2 F8 LDX #248 ;hides 'SED' |
| A0 02 LDY #2
| | E8 ... INX × 2 |
| 88 DEY
| | D0 FB BNE *-3</pre>||Clobbers X, Z&N, and D |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A0 88 LDY #136 ;hides 'DEY' |
| E6 xx INC @zptemp
| | 88 ... DEY × 2 |
| 36 36 ROL $36,X
| | 30 FB BMI *-3</pre>||Clobbers Y, and Z&N |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires @zptemp
| |
| |- | | |- |
| |<pre>FE 00 02 INC $0200,X | | !colspan="2"|7 bytes |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |- | | |- |
| |<pre>FE 00 03 INC $0300,X | | |<pre>98 TYA |
| 36 36 ROL $36,X
| | A0 06 LDY #6 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>FE 00 04 INC $0400,X | | |<pre>EA ... NOP × 2 |
| 36 36 ROL $36,X
| | A2 05 LDX #5 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| | CA DEX |
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>FE 00 05 INC $0500,X | | !colspan="2"|8 bytes |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |- | | |- |
| |<pre>FE 00 06 INC $0600,X | | |<pre>48 PHA |
| 36 36 ROL $36,X
| | 38 ... SEC × 2 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>FE 00 07 INC $0700,X | | |<pre>08 PHP |
| 36 36 ROL $36,X
| | 38 ... SEC × 2 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| !colspan="2"|8 bytes
| | |<pre>EA NOP |
| |-
| | 08 PHP |
| |<pre>C5 C5 CMP $C5 | | A2 04 LDX #4 |
| EA ... NOP × 2 | | CA DEX |
| 36 36 ROL $36,X
| | 10 FD BPL *-1 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and C
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |<pre>EA NOP |
| EA ... NOP × 2 | | 08 PHP |
| 36 36 ROL $36,X
| | A0 05 LDY #5 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and V
| | 88 DEY |
| |-
| | D0 FD BNE *-1 |
| |<pre>04 04 NOP $04
| | 28 PLP</pre>||Clobbers Y |
| EA ... NOP × 2
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|9 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>4C xx xx JMP *+3 | | |<pre>08 PHP |
| EA ... NOP × 2
| | 48 PHA |
| 36 36 ROL $36,X
| | 18 CLC |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and not relocatable code
| | A9 2A LDA #$2A ;hides 'ROL A' |
| |-
| | 90 FD BCC *-1 |
| !colspan="2"|10 bytes
| | 68 PLA |
| |-
| | 28 PLP</pre>||No requirements |
| |<pre>18 ... CLC × 8
| |
| 90 00 BCC *+2</pre>||Clobbers C | |
| |-
| |
| |<pre>B8 ... CLV × 8
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 8
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 8
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 8
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 20 cycles === | | === 36 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|5 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>A9 2A LDA #$2A ;hides 'ROL A' | | |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A' |
| 18 CLC
| | 2A ROL A ;first loop only |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C
| | B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>A2 07 LDX #7 |
| 20 xx xx JSR @rts15</pre>||Clobbers Z&N; requires @zptemp, @rts12, and @rts15; and writes in stack
| | CA DEX |
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>F6 F6 INC $F6,X | | |<pre>A0 06 LDY #6 |
| 20 xx xx JSR @rts14</pre>||Clobbers Z&N; requires @zptemp, @rts12, @rts14, and writable $00-$FF; and writes in stack
| | 88 DEY |
| | 10 FD BPL *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>68 ... PLA × 5</pre>||Clobbers A, S, and Z&N | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>38 SEC |
| 20 xx xx JSR @rts14</pre>||Clobbers S; requires @rts12, and @rts14; and writes in stack
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 38 SEC |
| | 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|8 bytes |
| 48 PHA
| |
| 20 xx xx JSR @rts15</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| |
| |- | | |- |
| !colspan="2"|6 bytes
| | |<pre>48 PHA |
| |-
| | 18 CLC |
| |<pre>BA TSX | | A9 2A LDA #$2A ;hides 'ROL A' |
| 68 ... PLA × 4
| | EA NOP |
| 9A TXS</pre>||Clobbers A, X, and Z&N; and unsafe for interrupts
| | 90 FC BCC *-2 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 48 PHA
| | 18 CLC |
| F6 F6 INC $F6,X
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 68 PLA
| | EA NOP |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack | | 90 FC BCC *-2 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>F6 F6 INC $F6,X | | |<pre>08 PHP |
| 68 PLA \ × 2
| | A2 04 LDX #4 |
| 48 PHA /</pre>||Clobbers A, and Z&N; and requires @zptemp, and writable $00-$FF
| | EA NOP |
| | CA DEX |
| | D0 FC BNE *-2 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>08 PHP |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| | A0 04 LDY #4 |
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>18 CLC
| | !colspan="2"|9 bytes |
| 90 00 BCC *+2
| |
| 20 xx xx JSR @rts15</pre>||Clobbers C; requires @rts12, and @rts15; and writes in stack
| |
| |- | | |- |
| |<pre>B8 CLV | | |<pre>20 xx xx JSR @rts12× 3</pre>||Requires @rts12 |
| 50 00 BVC *+2
| |
| 20 xx xx JSR @rts15</pre>||Clobbers V; requires @rts12, and @rts15; and writes in stack | |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|10 bytes |
| A5 A5 LDA $A5
| |
| 20 xx xx JSR @rts15</pre>||Clobbers A, and Z&N; requires @rts12, and @rts15; and writes in stack
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| A6 A6 LDX $A6
| | 48 PHA |
| 20 xx xx JSR @rts15</pre>||Clobbers X, and Z&N; requires @rts12, and @rts15; and writes in stack
| | 18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 38 SEC |
| | 10 FC BPL *-2 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>EA NOP | | |} |
| A4 A4 LDY $A4
| | |
| 20 xx xx JSR @rts15</pre>||Clobbers Y, and Z&N; requires @rts12, and @rts15; and writes in stack
| | |
| | === 37 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A5 A5 LDA $A5 |
| 85 xx STA @zptemp
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 20 xx xx JSR @rts15</pre>||Requires @zptemp, @rts12, and @rts15; and writes in stack
| | 18 CLC |
| | 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A2 04 LDX #4 |
| 04 04 NOP $04
| | EA ... NOP × 2 |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, @rts15, and support for unofficial opcodes; and writes in stack
| | CA DEX |
| | D0 FB BNE *-3</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>A0 04 LDY #4 |
| 08 PHP \ × 2
| | EA ... NOP × 2 |
| 28 PLP /</pre>||Clobbers S; and writes in stack
| | 88 DEY |
| | D0 FB BNE *-3</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>AA TAX | | !colspan="2"|8 bytes |
| 68 ... PLA × 4
| |
| 8C TXA</pre>||Clobbers X, S, and Z&N
| |
| |- | | |- |
| |<pre>A8 TAY | | |<pre>EA NOP |
| 68 ... PLA × 4
| | 98 TYA |
| 98 TYA</pre>||Clobbers Y, S, and Z&N | | A0 06 LDY #6 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| !colspan="2"|7 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>48 PHA |
| 08 PHP \ × 2
| | 98 TYA |
| 28 PLP /</pre>||Writes in stack
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| |<pre>98 TYA | | |<pre>08 PHP |
| A0 02 LDY #2 | | 98 TYA |
| | A0 05 LDY #5 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1
| | D0 FD BNE *-1 |
| A8 TAY</pre>||Clobbers A, and Z&N | | A8 TAY |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA ... NOP × 2 |
| A2 03 LDX #3 | | 08 PHP |
| | A2 04 LDX #4 |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA ... NOP × 2 |
| A0 02 LDY #2 | | 08 PHP |
| | A0 05 LDY #5 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| | D0 FD BNE *-1 |
| |-
| | 28 PLP</pre>||Clobbers Y |
| |<pre>EA NOP
| |
| F6 F6... INC $F6,X× 3</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N
| |
| |- | | |- |
| !colspan="2"|10 bytes | | !colspan="2"|10 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 10</pre>||No requirements | | |<pre>08 PHP |
| | 48 PHA |
| | 18 ... CLC × 2 |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 90 FD BCC *-1 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 21 cycles === | | === 38 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|4 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>68 ... PLA × 2 | | |<pre>38 SEC |
| 00 00 BRK 0</pre>||Clobbers A, S, and Z&N; requires dummy interrupt handler; and writes in stack
| | A9 69 LDA #$69 ;hides 'ADC #$EA' |
| | EA NOP ;first loop only |
| | B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V |
| |- | | |- |
| !colspan="2"|5 bytes
| | |<pre>EA NOP |
| |-
| | A2 07 LDX #7 |
| |<pre>18 CLC | |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 04 LDX #4
| |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N | | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>A0 03 LDY #3 | | |<pre>EA NOP |
| | A0 06 LDY #6 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N | | 10 FD BPL *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>08 PHP | | !colspan="2"|7 bytes |
| 28 PLP
| |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>F6 F6 INC $F6,X | | |<pre>48 PHA |
| 20 xx xx JSR @rts15</pre>||Clobbers Z&N; requires @zptemp, @rts12, @rts15, and writable $00-$FF; and writes in stack
| | 18 CLC |
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 90 FD BCC *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| F6 F6 INC $F6,X
| | 18 CLC |
| 00 00 BRK 0</pre>||Clobbers Z&N; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 90 FD BCC *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>08 PHP |
| 20 xx xx JSR @rts15</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| | A2 05 LDX #5 |
| | CA DEX |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| 48 ... PHA × 2
| | A0 06 LDY #6 |
| 00 00 BRK 0</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| | 88 DEY |
| |-
| | D0 FD BNE *-1 |
| !colspan="2"|6 bytes
| | 28 PLP</pre>||Clobbers Y |
| |-
| |
| |<pre>08 PHP \ × 3
| |
| 28 PLP /</pre>||Writes in stack | |
| |-
| |
| |<pre>68 PLA \ × 3
| |
| 48 PHA /</pre>||Clobbers A, and Z&N
| |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>08 PHP |
| E6 xx INC @zptemp
| | 48 PHA |
| 36 36 ROL $36,X
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires @zptemp
| | 10 FD BPL *-1 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>EA NOP | | |} |
| FE 00 02 INC $0200,X
| | |
| 36 36 ROL $36,X
| | |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| | === 39 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|4 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A9 4A LDA #$4A ;hides 'LSR A' |
| FE 00 03 INC $0300,X
| | D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|7 bytes |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A6 A6 LDX $A6 |
| FE 00 05 INC $0500,X
| | A2 07 LDX #7 |
| 36 36 ROL $36,X
| | CA DEX |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A4 A4 LDY $A4 |
| FE 00 06 INC $0600,X
| | A0 06 LDY #6 |
| 36 36 ROL $36,X
| | 88 DEY |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| | 10 FD BPL *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|8 bytes |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |- | | |- |
| !colspan="2"|9 bytes
| | |<pre>98 TYA |
| | A0 88 LDY #136 ;hides 'DEY' |
| | 88 ... DEY × 2 |
| | 30 FB BMI *-3 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | |<pre>08 PHP |
| EA ... NOP × 3
| | A2 05 LDX #5 ;hides 'ORA zp' |
| 36 36 ROL $36,X
| | CA DEX ;first loop only |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and C
| | CA DEX |
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers A, and X |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |<pre>08 PHP |
| EA ... NOP × 3
| | A0 05 LDY #5 ;hides 'ORA zp' |
| 36 36 ROL $36,X
| | 88 DEY ;first loop only |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and V
| | 88 DEY |
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers A, and Y |
| |- | | |- |
| |<pre>04 04 NOP $04 | | !colspan="2"|9 bytes |
| EA ... NOP × 3
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|10 bytes
| | |<pre>48 PHA |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | EA ... NOP × 3 |
| | 10 FA BPL *-4 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>4C xx xx JMP *+3 | | |<pre>08 PHP |
| EA ... NOP × 3 | | A9 2A LDA #$2A ;hides 'ROL A' |
| 36 36 ROL $36,X
| | EA ... NOP × 3 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and not relocatable code
| | 10 FA BPL *-4 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| !colspan="2"|11 bytes | | !colspan="2"|10 bytes |
| |- | | |- |
| |<pre>18 ... CLC × 9 | | |<pre>EA NOP |
| 90 00 BCC *+2</pre>||Clobbers C
| | 48 PHA |
| | 98 TYA |
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| |<pre>B8 ... CLV × 9 | | |<pre>08 PHP |
| 50 00 BVC *+2</pre>||Clobbers V
| | A6 A6 LDX $A6 |
| | A2 04 LDX #4 |
| | EA NOP |
| | CA DEX |
| | D0 FC BNE *-2 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA ... NOP × 9 | | |<pre>08 PHP |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| | A4 A4 LDY $A4 |
| | A0 04 LDY #4 |
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>EA ... NOP × 9 | | !colspan="2"|11 bytes |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |- | | |- |
| !colspan="2"|12 bytes
| | |<pre>08 PHP |
| |-
| | 48 PHA |
| |<pre>EA ... NOP × 9 | | 98 TYA |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| | A0 04 LDY #4 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 22 cycles === | | === 40 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|5 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>A2 05 LDX #5 ;hides 'ORA zp' |
| 28 PLP
| | EA NOP |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, and @rts15; and writes in stack
| | CA DEX |
| | D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A0 05 LDY #5 ;hides 'ORA zp' |
| 08 PHP
| | EA NOP |
| 28 PLP
| | 88 DEY |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| | D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N |
| |- | | |- |
| |<pre>68 ... PLA × 2
| | !colspan="2"|7 bytes |
| 20 xx xx JSR @rts14</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| !colspan="2"|6 bytes
| | |<pre>98 TYA |
| | A0 06 LDY #6 |
| | 88 DEY |
| | 10 FD BPL *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>18 CLC | | |<pre>EA ... NOP × 2 |
| A9 2A LDA #$2A ;hides 'ROL A'
| | A2 07 LDX #7 |
| 38 SEC
| |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 03 LDX #3
| |
| EA NOP
| |
| CA DEX | | CA DEX |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N | | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>A0 02 LDY #2 | | |<pre>EA ... NOP × 2 |
| EA NOP
| | A0 06 LDY #6 |
| 88 DEY | | 88 DEY |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N | | 10 FD BPL *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|8 bytes |
| F6 F6 INC $F6,X
| |
| 20 xx xx JSR @rts14</pre>||Clobbers Z&N; requires @zptemp, @rts12, @rts14, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 ... PLA × 5</pre>||Clobbers A, S, and Z&N
| |
| |- | | |- |
| |<pre>48 PHA | | |<pre>48 PHA |
| 08 PHP
| | 18 ... CLC × 2 |
| 28 PLP
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 20 xx xx JSR @rts12</pre>||Clobbers S; requires @rts12; and writes in stack
| | 90 FD BCC *-1 |
| |-
| | 68 PLA</pre>||Clobbers Z&N, and C |
| !colspan="2"|7 bytes
| |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| BA TSX
| | 18 ... CLC × 2 |
| 08 PHP
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 28 ... PLP × 2
| | 90 FD BCC *-1 |
| 9A TXS
| | 28 PLP</pre>||Clobbers A |
| 28 PLP</pre>||Clobbers X; and writes in stack | |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| 08 PHP | | 08 PHP |
| 48 PHA
| | A2 05 LDX #5 |
| F6 F6 INC $F6,X
| | CA DEX |
| 68 PLA
| | 10 FD BPL *-1 |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack | | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| F6 F6 INC $F6,X
| |
| 68 PLA \ × 2
| |
| 48 PHA /</pre>||Clobbers A, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>08 PHP
| |
| C5 C5 CMP $C5
| |
| 28 PLP
| |
| 20 xx xx JSR @rts12</pre>||Requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP | | 08 PHP |
| 36 36 ROL $36,X
| | A0 06 LDY #6 |
| 76 36 ROR $36,X
| | 88 DEY |
| 28 PLP</pre>||Clobbers S; and writes in stack | | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 24 24 BIT $24
| | 48 PHA |
| 36 36 ROL $36,X
| | 18 CLC |
| 76 36 ROR $36,X
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 28 PLP</pre>||Writes in stack
| | 10 FD BPL *-1 |
| |-
| | 68 PLA |
| |<pre>26 26 ROL $26
| | 28 PLP</pre>||No requirements |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 11</pre>||No requirements
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 23 cycles === | | === 41 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|5 bytes | | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>A9 2A LDA #$2A ;hides 'ROL A' | | |<pre>38 SEC |
| 48 PHA
| | A9 4A LDA #$4A ;hides 'LSR A' |
| 10 FC BPL *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| | D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>68 ... PLA × 2 | | |<pre>A2 08 LDX #8 |
| 20 xx xx JSR @rts15</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP | |
| 28 PLP
| |
| 00 00 BRK 0</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 2
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 04 LDX #4
| |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N | | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A0 08 LDY #8 |
| A0 03 LDY #3 | |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|7 bytes |
| 08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>48 PHA |
| F6 F6 INC $F6,X
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 20 xx xx JSR @rts15</pre>||Clobbers Z&N; requires @zptemp, @rts12, @rts15, and writable $00-$FF; and writes in stack
| | 18 CLC |
| | 10 FC BPL *-2 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| C5 C5 CMP $C5
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 28 PLP | | 18 CLC |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| | 10 FC BPL *-2 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>68 PLA | | |<pre>08 PHP |
| 48 PHA
| | A0 88 LDY #136 ;hides 'DEY' |
| 68 ... PLA × 4</pre>||Clobbers A, S, and Z&N
| | 88 DEY |
| | 30 FC BMI *-2 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>EA NOP
| | !colspan="2"|9 bytes |
| 48 ... PHA × 2
| |
| 20 xx xx JSR @rts15</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| |
| |- | | |- |
| !colspan="2"|7 bytes
| | |<pre>08 PHP |
| | A6 A6 LDX $A6 |
| | A2 05 LDX #5 |
| | CA DEX |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA NOP | | !colspan="2"|10 bytes |
| 08 PHP \ × 3
| |
| 28 PLP /</pre>||Writes in stack
| |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| 68 PLA \ × 3 | | 48 PHA |
| 48 PHA /</pre>||Clobbers A, and Z&N
| | A5 A5 LDA $A5 |
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 10 FD BPL *-1 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| !colspan="2"|8 bytes | | |} |
| | |
| | |
| | === 42 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>A5 A5 LDA $A5 |
| F6 F6... INC $F6,X× 3</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| | A9 4A LDA #$4A ;hides 'LSR A' |
| | D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| !colspan="2"|9 bytes | | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>E6 xx INC @zptemp | | |<pre>EA NOP |
| EA ... NOP × 3 | | A2 05 LDX #5 ;hides 'ORA zp' |
| 36 36 ROL $36,X
| | EA NOP |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires @zptemp
| | CA DEX |
| | D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA NOP |
| FE 00 02 INC $0200,X
| | A0 05 LDY #5 ;hides 'ORA zp' |
| 36 36 ROL $36,X
| | EA NOP |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| | 88 DEY |
| | D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 2
| | !colspan="2"|8 bytes |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>48 PHA |
| FE 00 04 INC $0400,X
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 36 36 ROL $36,X
| | 08 PHP |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| | 28 PLP |
| | 10 FB BPL *-3 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>08 PHP |
| FE 00 05 INC $0500,X
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 36 36 ROL $36,X
| | 08 PHP |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| | 28 PLP |
| | 10 FB BPL *-3 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>08 PHP |
| FE 00 06 INC $0600,X
| | A2 F8 LDX #248 ;hides 'SED' |
| 36 36 ROL $36,X
| | E8 ... INX × 2 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>08 PHP |
| FE 00 07 INC $0700,X
| | A0 88 LDY #136 ;hides 'DEY' |
| 36 36 ROL $36,X
| | 88 ... DEY × 2 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| | 30 FB BMI *-3 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| !colspan="2"|10 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | |<pre>48 PHA |
| 26 26 ROL $26 \ × 2
| | 98 TYA |
| 66 26 ROR $26 /</pre>||Clobbers Z&N, and C
| | A0 06 LDY #6 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| |<pre>24 24 BIT $24
| | !colspan="2"|10 bytes |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N, and V
| |
| |- | | |- |
| |<pre>04 04 NOP $04 | | |<pre>08 PHP |
| 26 26 ROL $26 \ × 2
| | 48 PHA |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| | 38 ... SEC × 2 |
| |-
| | A9 0A LDA #$0A ;hides 'ASL A' |
| !colspan="2"|11 bytes
| | 10 FD BPL *-1 |
| |-
| | 68 PLA |
| |<pre>4C xx xx JMP *+3
| | 28 PLP</pre>||No requirements |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 10
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 10
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 10
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 10
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 10
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 24 cycles === | | === 43 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 68 ... PLA × 2
| |
| 00 00 BRK 0</pre>||Clobbers A, S, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>20 xx xx JSR @rts12× 2</pre>||Requires @rts12; and writes in stack | | |<pre>38 ... SEC × 2 |
| | A9 4A LDA #$4A ;hides 'LSR A' |
| | D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>A2 05 LDX #5 |
| 08 PHP
| | EA NOP |
| 28 PLP
| |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 6</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 04 LDX #4 | |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| | 10 FC BPL *-2</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>48 PHA | | |<pre>A0 06 LDY #6 |
| A0 03 LDY #3 | | EA NOP |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| | D0 FC BNE *-2</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| !colspan="2"|7 bytes | | !colspan="2"|7 bytes |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |- | | |- |
| |<pre>48 PHA | | |<pre>48 PHA |
| 08 PHP \ × 3
| | A9 E9 LDA #$E9 ;hides 'SBC #$2A' |
| 28 PLP /</pre>||Clobbers S; and writes in stack
| | 2A ROL A ;first loop only |
| |-
| | B0 FC BCS *-2 |
| !colspan="2"|8 bytes
| | 68 PLA</pre>||Clobbers Z&N, C, and V |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 48 PHA
| | A9 E9 LDA #$E9 ;hides 'SBC #$2A' |
| 26 26 ROL $26
| | 2A ROL A ;first loop only |
| 66 26 ROR $26
| | B0 FC BCS *-2 |
| 68 PLA
| | 28 PLP</pre>||Clobbers A |
| 28 PLP</pre>||Writes in stack | | |- |
| | |<pre>08 PHP |
| | A2 07 LDX #7 |
| | CA DEX |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| | |- |
| | |<pre>08 PHP |
| | A0 06 LDY #6 |
| | 88 DEY |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers Y |
| | |- |
| | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>36 36 ROL $36,X \ × 2 | | |<pre>48 PHA |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| | 38 SEC |
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 38 SEC |
| | 10 FC BPL *-2 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| !colspan="2"|12 bytes | | !colspan="2"|10 bytes |
| |- | | |- |
| |<pre>EA ... NOP × 12</pre>||No requirements | | |<pre>08 PHP |
| | 48 PHA |
| | 18 CLC |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | EA NOP |
| | 90 FC BCC *-2 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 25 cycles === | | === 44 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler, and @rts12; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 3
| |
| 00 00 BRK 0</pre>||Clobbers A, S, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>36 36 ROL $36,X | | |<pre>A9 0A LDA #$0A ;hides 'ASL A' |
| 76 36 ROR $36,X
| | EA ... NOP × 2 |
| 00 00 BRK 0</pre>||Clobbers Z&N; requires dummy interrupt handler; and writes in stack
| | 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>08 PHP | | |<pre>A0 88 LDY #136 ;hides 'DEY' |
| E6 xx INC @zptemp
| | EA NOP |
| 28 PLP
| | 88 DEY |
| 00 00 BRK 0</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| | 30 FB BMI *-3</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>68 PLA | | !colspan="2"|7 bytes |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |- | | |- |
| |<pre>A2 03 LDX #3 | | |<pre>A6 A6 LDX $A6 |
| 48 PHA
| | A2 08 LDX #8 |
| CA DEX | | CA DEX |
| D0 FC BNE *-2</pre>||Clobbers X, S, and Z&N; and writes in stack | | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>68 PLA | | !colspan="2"|9 bytes |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |- | | |- |
| |<pre>A0 02 LDY #2 | | |<pre>C5 C5 CMP $C5 |
| 48 PHA | | 48 PHA |
| 88 DEY
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 10 FC BPL *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack | | 18 CLC |
| | 10 FC BPL *-2 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>68 PLA | | |<pre>08 PHP |
| A0 03 LDY #3 | | A5 A5 LDA $A5 |
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 18 CLC |
| | 10 FC BPL *-2 |
| | 28 PLP</pre>||Clobbers A |
| | |- |
| | |<pre>08 PHP |
| | A2 04 LDX #4 |
| | EA ... NOP × 2 |
| | CA DEX |
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers X |
| | |- |
| | |<pre>08 PHP |
| | A0 04 LDY #4 |
| | EA ... NOP × 2 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers Y |
| | |- |
| | !colspan="2"|10 bytes |
| |- | | |- |
| |<pre>48 PHA | | |<pre>EA NOP |
| 08 PHP
| | 48 PHA |
| 28 PLP
| | 98 TYA |
| 20 xx xx JSR @rts15</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| | A0 06 LDY #6 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| |<pre>48 PHA
| | !colspan="2"|11 bytes |
| 68 ... PLA × 2
| |
| 20 xx xx JSR @rts14</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>48 ... PHA × 4 | | |<pre>08 PHP |
| 00 00 BRK 0</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| | 48 PHA |
| | 98 TYA |
| | A0 05 LDY #5 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| | |} |
| | |
| | |
| | === 45 cycles === |
| | {| class="wikitable testtable" |
| !colspan="2"|7 bytes | | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>98 TYA | | |<pre>98 TYA |
| A0 03 LDY #3 | | A0 08 LDY #8 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1
| | D0 FD BNE *-1 |
| A8 TAY</pre>||Clobbers A, and Z&N | | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA ... NOP × 2 |
| A2 04 LDX #4 | | A2 08 LDX #8 |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N | | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>EA ... NOP × 2 |
| A0 03 LDY #3 | | A0 08 LDY #8 |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>20 xx xx JSR @rts12 | | !colspan="2"|8 bytes |
| 08 PHP
| |
| F6 F6 INC $F6,X
| |
| 28 PLP</pre>||Requires @zptemp, @rts12, and writable $00-$FF; and writes in stack
| |
| |- | | |- |
| |<pre>EA ... NOP × 2 | | |<pre>48 PHA |
| 08 PHP
| | 38 SEC |
| 28 PLP
| | A9 69 LDA #$69 ;hides 'ADC #$EA' |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| | EA NOP ;first loop only |
| | B0 FC BCS *-2 |
| | 68 PLA</pre>||Clobbers Z&N, C, and V |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| C5 C5 CMP $C5
| | 38 SEC |
| 28 PLP
| | A9 69 LDA #$69 ;hides 'ADC #$EA' |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, and @rts15; and writes in stack
| | EA NOP ;first loop only |
| |-
| | B0 FC BCS *-2 |
| |<pre>48 PHA
| | 28 PLP</pre>||Clobbers A |
| A9 00 LDA #0 | |
| 20 xx xx JSR delay_256a_16_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks, and delay_256a_16_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 00 LDA #0
| |
| 20 xx xx JSR delay_256a_16_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks, and delay_256a_16_clocks; and writes in stack | |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA NOP |
| 08 PHP | | 08 PHP |
| C5 C5 CMP $C5
| | A2 07 LDX #7 |
| 28 PLP | | CA DEX |
| 00 00 BRK 0</pre>||Requires dummy interrupt handler; and writes in stack
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>EA NOP |
| 08 PHP | | 08 PHP |
| 28 PLP
| | A0 06 LDY #6 |
| 20 xx xx JSR @rts12</pre>||Clobbers S; requires @rts12; and writes in stack
| | 88 DEY |
| |-
| | 10 FD BPL *-1 |
| !colspan="2"|8 bytes
| | 28 PLP</pre>||Clobbers Y |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP \ × 3
| |
| 28 PLP /</pre>||Writes in stack | |
| |- | | |- |
| !colspan="2"|9 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>08 PHP |
| E6 xx INC @zptemp
| | 48 PHA |
| F6 F6... INC $F6,X× 3</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| | 18 CLC |
| |-
| | A9 0A LDA #$0A ;hides 'ASL A' |
| |<pre>85 xx STA @zptemp
| | 90 FD BCC *-1 |
| 68 PLA | | 68 PLA |
| 48 PHA
| | 28 PLP</pre>||No requirements |
| 68 ... PLA × 3
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, and Z&N; and requires @zptemp
| |
| |- | | |- |
| !colspan="2"|10 bytes | | |} |
| | |
| | |
| | === 46 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|5 bytes |
| |- | | |- |
| |<pre>C5 C5 CMP $C5 | | |<pre>A2 08 LDX #8 |
| 26 26 ROL $26
| | CA DEX |
| 66 26 ROR $26
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and C
| |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |<pre>A0 09 LDY #9 |
| 26 26 ROL $26
| | 88 DEY |
| 66 26 ROR $26
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N, and V
| |
| |- | | |- |
| |<pre>E6 xx INC @zptemp
| | !colspan="2"|6 bytes |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires @zptemp
| |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>48 PHA |
| FE 00 02 INC $0200,X
| | A9 4A LDA #$4A ;hides 'LSR A' |
| 36 36 ROL $36,X
| | D0 FD BNE *-1 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>08 PHP |
| FE 00 03 INC $0300,X
| | A9 4A LDA #$4A ;hides 'LSR A' |
| 36 36 ROL $36,X
| | D0 FD BNE *-1 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | !colspan="2"|9 bytes |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>08 PHP |
| FE 00 05 INC $0500,X
| | A6 A6 LDX $A6 |
| 36 36 ROL $36,X
| | A2 07 LDX #7 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| | CA DEX |
| |- | | D0 FD BNE *-1 |
| |<pre>EA ... NOP × 3 | | 28 PLP</pre>||Clobbers X |
| FE 00 06 INC $0600,X
| | |- |
| 36 36 ROL $36,X
| | |<pre>08 PHP |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| | A4 A4 LDY $A4 |
| | A0 06 LDY #6 |
| | 88 DEY |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | !colspan="2"|10 bytes |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |- | | |- |
| |<pre>04 04 NOP $04 | | |<pre>48 PHA |
| 26 26 ROL $26
| | 98 TYA |
| 66 26 ROR $26
| | A0 88 LDY #136 ;hides 'DEY' |
| 36 36 ROL $36,X
| | 88 ... DEY × 2 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| | 30 FB BMI *-3 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| !colspan="2"|11 bytes | | !colspan="2"|11 bytes |
| |- | | |- |
| |<pre>4C xx xx JMP *+3 | | |<pre>08 PHP |
| 26 26 ROL $26
| | 48 PHA |
| 66 26 ROR $26
| | A9 2A LDA #$2A ;hides 'ROL A' |
| 36 36 ROL $36,X
| | EA ... NOP × 3 |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and not relocatable code
| | 10 FA BPL *-4 |
| |-
| | 68 PLA |
| !colspan="2"|13 bytes
| | 28 PLP</pre>||No requirements |
| |-
| |
| |<pre>18 ... CLC × 11
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 11
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 11
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 11
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 11
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 26 cycles === | | === 47 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|4 bytes | | !colspan="2"|8 bytes |
| |- | | |- |
| |<pre>00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack | | |<pre>98 TYA |
| | A0 06 LDY #6 |
| | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| !colspan="2"|5 bytes
| | |<pre>EA ... NOP × 3 |
| | A2 08 LDX #8 |
| | CA DEX |
| | D0 FD BNE *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>18 CLC | | |<pre>08 PHP |
| A9 0A LDA #$0A ;hides 'ASL A'
| | A2 05 LDX #5 ;hides 'ORA zp' |
| 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C
| | EA NOP |
| |-
| |
| |<pre>A2 04 LDX #4
| |
| CA DEX | | CA DEX |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers A, and X |
| |- | | |- |
| |<pre>A0 05 LDY #5 | | |<pre>EA ... NOP × 3 |
| | A0 08 LDY #8 |
| 88 DEY | | 88 DEY |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N | | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| !colspan="2"|6 bytes
| | |<pre>08 PHP |
| | A0 05 LDY #5 ;hides 'ORA zp' |
| | EA NOP |
| | 88 DEY |
| | D0 FB BNE *-3 |
| | 28 PLP</pre>||Clobbers A, and Y |
| |- | | |- |
| |<pre>20 xx xx JSR @rts12 | | !colspan="2"|9 bytes |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |- | | |- |
| |<pre>48 PHA | | |<pre>48 PHA |
| 68 ... PLA × 2 | | 98 TYA |
| 20 xx xx JSR @rts15</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts15; and writes in stack
| | A0 06 LDY #6 |
| | 88 DEY |
| | 10 FD BPL *-1 |
| | A8 TAY |
| | 68 PLA</pre>||Clobbers Z&N |
| |- | | |- |
| !colspan="2"|7 bytes
| | |<pre>08 PHP |
| | 98 TYA |
| | A0 06 LDY #6 |
| | 88 DEY |
| | 10 FD BPL *-1 |
| | A8 TAY |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA ... NOP × 2 |
| 20 xx xx JSR @rts12× 2</pre>||Requires @rts12; and writes in stack
| | 08 PHP |
| | A2 07 LDX #7 |
| | CA DEX |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>EA NOP | | |<pre>EA ... NOP × 2 |
| 68 ... PLA × 6</pre>||Clobbers A, S, and Z&N
| | 08 PHP |
| | A0 06 LDY #6 |
| | 88 DEY |
| | 10 FD BPL *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| !colspan="2"|8 bytes | | !colspan="2"|10 bytes |
| |- | | |- |
| |<pre>08 PHP | | |<pre>08 PHP |
| 48 PHA | | 48 PHA |
| 36 36 ROL $36,X
| | 18 ... CLC × 2 |
| 76 36 ROR $36,X
| | A9 0A LDA #$0A ;hides 'ASL A' |
| | 90 FD BCC *-1 |
| 68 PLA | | 68 PLA |
| 28 PLP</pre>||Writes in stack | | 28 PLP</pre>||No requirements |
| |-
| |
| |<pre>98 TYA
| |
| A0 02 LDY #2
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 13</pre>||No requirements
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 27 cycles === | | === 48 cycles === |
| {| class="wikitable testtable" | | {| class="wikitable testtable" |
| !colspan="2"|5 bytes | | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>A9 00 LDA #0 | | |<pre>EA NOP |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| | A2 08 LDX #8 |
| | CA DEX |
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>00 00 BRK 0 | | |<pre>EA NOP |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| | A0 09 LDY #9 |
| | 88 DEY |
| | D0 FD BNE *-1</pre>||Clobbers Y, and Z&N |
| | |- |
| | !colspan="2"|7 bytes |
| |- | | |- |
| |<pre>48 PHA | | |<pre>48 PHA |
| A9 0A LDA #$0A ;hides 'ASL A' | | 38 SEC |
| 10 FD BPL *-1</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| | A9 4A LDA #$4A ;hides 'LSR A' |
| |-
| | D0 FD BNE *-1 |
| !colspan="2"|6 bytes
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>A5 A5 LDA $A5 | | |<pre>08 PHP |
| A9 0A LDA #$0A ;hides 'ASL A' | | 38 SEC |
| 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C
| | A9 4A LDA #$4A ;hides 'LSR A' |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>20 xx xx JSR @rts12 | | |<pre>08 PHP |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, and @rts15; and writes in stack
| | A2 08 LDX #8 |
| | CA DEX |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>00 00 BRK 0 | | |<pre>08 PHP |
| 08 PHP \ × 2 | | A0 08 LDY #8 |
| 28 PLP /</pre>||Requires dummy interrupt handler; and writes in stack | | 88 DEY |
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| !colspan="2"|7 bytes | | !colspan="2"|9 bytes |
| |- | | |- |
| |<pre>48 PHA | | |<pre>08 PHP |
| A9 2A LDA #$2A ;hides 'ROL A' | | 48 PHA |
| | A9 0A LDA #$0A ;hides 'ASL A' |
| 18 CLC | | 18 CLC |
| 10 FC BPL *-2 | | 10 FC BPL *-2 |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack | | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| |<pre>08 PHP | | |} |
| A9 2A LDA #$2A ;hides 'ROL A'
| | |
| 18 CLC
| | |
| 10 FC BPL *-2
| | === 49 cycles === |
| 28 PLP</pre>||Clobbers A; and writes in stack
| | {| class="wikitable testtable" |
| | !colspan="2"|4 bytes |
| |- | | |- |
| |<pre>A2 04 LDX #4 | | |<pre>A0 88 LDY #136 ;hides 'DEY' |
| CA DEX
| | 30 FD BMI *-1</pre>||Clobbers Y, and Z&N |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |- | | |- |
| |<pre>F6 F6 INC $F6,X | | !colspan="2"|7 bytes |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |- | | |- |
| |<pre>08 PHP | | |<pre>18 CLC |
| F6 F6 INC $F6,X
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 08 PHP |
| 28 PLP | | 28 PLP |
| 20 xx xx JSR @rts14</pre>||Requires @zptemp, @rts12, @rts14, and writable $00-$FF; and writes in stack
| | 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C |
| |- | | |- |
| |<pre>A2 82 LDX #130 ;hides 'NOP #imm' | | |<pre>A6 A6 LDX $A6 |
| 04 EA NOP $EA ;hides 'NOP'
| | A2 08 LDX #8 |
| CA DEX | | CA DEX |
| 30 FA BMI *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| | 10 FD BPL *-1</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>A0 82 LDY #130 ;hides 'NOP #imm' | | !colspan="2"|8 bytes |
| 04 EA NOP $EA ;hides 'NOP'
| |
| 88 DEY
| |
| 30 FA BMI *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |- | | |- |
| |<pre>68 PLA | | |<pre>C5 C5 CMP $C5 |
| 48 PHA | | 48 PHA |
| 68 ... PLA × 5</pre>||Clobbers A, S, and Z&N | | A9 4A LDA #$4A ;hides 'LSR A' |
| | D0 FD BNE *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>08 PHP |
| A2 04 LDX #4
| | A5 A5 LDA $A5 |
| CA DEX
| | A9 4A LDA #$4A ;hides 'LSR A' |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack | | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | !colspan="2"|10 bytes |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack | |
| |- | | |- |
| |<pre>48 PHA | | |<pre>08 PHP |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers S; requires @rts12; and writes in stack
| | 48 PHA |
| | A9 2A LDA #$2A ;hides 'ROL A' |
| | 08 PHP |
| | 28 PLP |
| | 10 FB BPL *-3 |
| | 68 PLA |
| | 28 PLP</pre>||No requirements |
| |- | | |- |
| !colspan="2"|8 bytes | | |} |
| | |
| | |
| | === 50 cycles === |
| | {| class="wikitable testtable" |
| | !colspan="2"|6 bytes |
| |- | | |- |
| |<pre>EA NOP | | |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A' |
| 98 TYA
| | 2A ROL A ;first loop only |
| A0 03 LDY #3
| | EA NOP |
| 88 DEY
| | B0 FB BCS *-3</pre>||Clobbers A, Z&N, C, and V |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>A2 07 LDX #7 |
| A2 04 LDX #4 | | EA NOP |
| CA DEX | | CA DEX |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N | | D0 FC BNE *-2</pre>||Clobbers X, and Z&N |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>A0 06 LDY #6 |
| A0 03 LDY #3 | | EA NOP |
| 88 DEY | | 88 DEY |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N | | 10 FC BPL *-2</pre>||Clobbers Y, and Z&N |
| |- | | |- |
| |<pre>08 PHP
| | !colspan="2"|7 bytes |
| F6 F6 INC $F6,X
| |
| 28 PLP \ × 2
| |
| 08 PHP /
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |- | | |- |
| |<pre>24 24 BIT $24 | | |<pre>98 TYA |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers Z&N, and V; requires @rts12; and writes in stack
| | A0 09 LDY #9 |
| | 88 DEY |
| | D0 FD BNE *-1 |
| | A8 TAY</pre>||Clobbers A, and Z&N |
| |- | | |- |
| |<pre>20 xx xx JSR @rts12 | | !colspan="2"|8 bytes |
| 08 PHP
| |
| BA TSX
| |
| 28 PLP
| |
| 9A TXS
| |
| 28 PLP</pre>||Clobbers X; requires @rts12; and writes in stack
| |
| |- | | |- |
| |<pre>85 xx STA @zptemp | | |<pre>48 PHA |
| 20 xx xx JSR @rts12× 2</pre>||Requires @zptemp, and @rts12; and writes in stack
| | 38 ... SEC × 2 |
| | A9 4A LDA #$4A ;hides 'LSR A' |
| | D0 FD BNE *-1 |
| | 68 PLA</pre>||Clobbers Z&N, and C |
| |- | | |- |
| |<pre>EA ... NOP × 3 | | |<pre>08 PHP |
| 08 PHP
| | 38 ... SEC × 2 |
| 28 PLP | | A9 4A LDA #$4A ;hides 'LSR A' |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| | D0 FD BNE *-1 |
| | 28 PLP</pre>||Clobbers A |
| |- | | |- |
| |<pre>04 04 NOP $04 | | |<pre>08 PHP |
| 20 xx xx JSR @rts12× 2</pre>||Requires @rts12, and support for unofficial opcodes; and writes in stack
| | A2 05 LDX #5 |
| | EA NOP |
| | CA DEX |
| | 10 FC BPL *-2 |
| | 28 PLP</pre>||Clobbers X |
| |- | | |- |
| |<pre>48 ... PHA × 2 | | |<pre>08 PHP |
| 08 PHP \ × 3 | | A0 06 LDY #6 |
| 28 PLP /</pre>||Clobbers S; and writes in stack | | EA NOP |
| | 88 DEY |
| | D0 FC BNE *-2 |
| | 28 PLP</pre>||Clobbers Y |
| |- | | |- |
| !colspan="2"|9 bytes | | !colspan="2"|9 bytes |
Line 2,231: |
Line 2,188: |
| |<pre>08 PHP | | |<pre>08 PHP |
| 48 PHA | | 48 PHA |
| A9 6A LDA #$6A ;hides 'ROR A' | | A9 E9 LDA #$E9 ;hides 'SBC #$2A' |
| 38 SEC
| | 2A ROL A ;first loop only |
| 10 FC BPL *-2
| | B0 FC BCS *-2 |
| 68 PLA | | 68 PLA |
| 28 PLP</pre>||Writes in stack | | 28 PLP</pre>||No requirements |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 12
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 12
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 12
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 12
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 12
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |- | | |- |
| |} | | |} |
|
| |
|
|
| |
|
| === 28 cycles === | | == Sanity checks == |
| {| class="wikitable testtable"
| | |
| !colspan="2"|5 bytes
| | It is possible to verify on compile time that no page wrap occurs, |
| |-
| | by replacing all branches with these macros: |
| |<pre>A9 01 LDA #1
| | <pre>.macro branch_check opc, dest |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| | opc dest |
| |-
| | .assert >* = >(dest), warning, "branch_check: failed, crosses page" |
| |<pre>EA NOP
| | .endmacro |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| | .macro bccnw dest |
| |-
| | branch_check bcc, dest |
| |<pre>68 PLA
| | .endmacro |
| A9 0A LDA #$0A ;hides 'ASL A'
| | .macro bcsnw dest |
| 10 FD BPL *-1</pre>||Clobbers A, S, Z&N, and C
| | branch_check bcs, dest |
| |-
| | .endmacro |
| !colspan="2"|6 bytes
| | .macro beqnw dest |
| |-
| | branch_check beq, dest |
| |<pre>18 ... CLC × 2
| | .endmacro |
| A9 0A LDA #$0A ;hides 'ASL A'
| | .macro bnenw dest |
| 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C
| | branch_check bne, dest |
| |-
| | .endmacro |
| |<pre>EA NOP
| | .macro bminw dest |
| A2 04 LDX #4
| | branch_check bmi, dest |
| CA DEX
| | .endmacro |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| | .macro bplnw dest |
| |-
| | branch_check bpl, dest |
| |<pre>EA NOP
| | .endmacro |
| A0 05 LDY #5
| | .macro bvcnw dest |
| 88 DEY
| | branch_check bvc, dest |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| | .endmacro |
| |-
| | .macro bvsnw dest |
| |<pre>20 xx xx JSR @rts14× 2</pre>||Requires @rts12, and @rts14; and writes in stack
| | branch_check bvs, dest |
| |-
| | .endmacro</pre> |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| 28 PLP
| |
| 20 xx xx JSR @rts15</pre>||Requires @zptemp, @rts12, @rts15, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 7</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts15</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP \ × 4
| |
| 28 PLP /</pre>||Writes in stack
| |
| |-
| |
| |<pre>68 PLA \ × 4
| |
| 48 PHA /</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 14</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 29 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 02 LDA #2
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 00 00... BRK 0 × 2</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA NOP
| |
| 90 FC BCC *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 04 LDX #4
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>20 xx xx JSR @rts14
| |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 00 00... BRK 0 × 2</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 00 00... BRK 0 × 2</pre>||Clobbers Z&N, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 00 00... BRK 0 × 2</pre>||Clobbers A, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 00 00... BRK 0 × 2</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00 BRK 0
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00 BRK 0
| |
| 08 PHP \ × 2
| |
| 28 PLP /</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts14</pre>||Clobbers S; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 03 LDX #3
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 02 LDY #2
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers Z&N; requires @zptemp, and @rts12; and writes in stack
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts14</pre>||Clobbers Z&N, and V; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts14</pre>||Requires @zptemp, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, @rts14, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers S; requires @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| F6 F6 INC $F6,X
| |
| 28 PLP \ × 2
| |
| 08 PHP /
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 08 PHP
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 28 PLP</pre>||Requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 13
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 13
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 13
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 13
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 13
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 30 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 03 LDA #3
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 00 00... BRK 0 × 2</pre>||Clobbers A, S, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts14× 2</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 ... CLC × 2
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 ... CLC × 2
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers Z&N; requires @zptemp, @rts12, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers S; requires @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 6A LDA #$6A ;hides 'ROR A'
| |
| 90 FD BCC *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>F6 F6... INC $F6,X× 5</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 ... PLA × 6
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, and Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 15</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 31 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 00 00... BRK 0 × 2</pre>||Clobbers Z&N; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 00 00... BRK 0 × 2</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts14
| |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| 90 00 BCC *+2
| |
| 00 00... BRK 0 × 2</pre>||Clobbers C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>B8 CLV
| |
| 50 00 BVC *+2
| |
| 00 00... BRK 0 × 2</pre>||Clobbers V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 85 xx STA @zptemp
| |
| 00 00... BRK 0 × 2</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 00 00 BRK 0
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 20 xx xx JSR @rts14× 2</pre>||Clobbers S; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts12× 2</pre>||Requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 00 00 BRK 0
| |
| 08 PHP \ × 2
| |
| 28 PLP /</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| 68 ... PLA × 6</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 82 LDY #130 ;hides 'NOP #imm'
| |
| 04 EA NOP $EA ;hides 'NOP'
| |
| 88 DEY
| |
| 30 FA BMI *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP \ × 4
| |
| 28 PLP /</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| E6 xx INC @zptemp
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 14
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 14
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 14
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 14
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 14
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 32 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 05 LDA #5
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 05 LDX #5 ;hides 'ORA zp'
| |
| CA DEX ;first loop only
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>A0 05 LDY #5 ;hides 'ORA zp'
| |
| 88 DEY ;first loop only
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 00 00... BRK 0 × 2</pre>||Clobbers Z&N; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 00 00... BRK 0 × 2</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 05 LDX #5
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>AA TAX
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 8C TXA</pre>||Clobbers X, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A8 TAY
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 98 TYA</pre>||Clobbers Y, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A2 7A LDX #122 ;hides 'NOP'
| |
| EA NOP
| |
| E8 ... INX × 2
| |
| 10 FA BPL *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A0 7A LDY #122 ;hides 'NOP'
| |
| EA NOP
| |
| C8 ... INY × 2
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>AA TAX
| |
| 68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 8C TXA</pre>||Clobbers X, S, Z&N, and C
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A8 TAY
| |
| 68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 98 TYA</pre>||Clobbers Y, S, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| 20 xx xx JSR @rts14× 2</pre>||Clobbers A, S, and Z&N; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 04 LDX #4
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 20 xx xx JSR @rts14× 2</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 03 LDX #3
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 02 LDY #2
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts12
| |
| 08 PHP
| |
| F6 F6 INC $F6,X
| |
| 28 PLP</pre>||Requires @zptemp, @rts12, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 00 LDA #0
| |
| 20 xx xx JSR delay_256a_16_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks, and delay_256a_16_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 2
| |
| 20 xx xx JSR @rts12× 2</pre>||Clobbers S; requires @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 ... CLC × 2
| |
| A9 6A LDA #$6A ;hides 'ROR A'
| |
| 90 FD BCC *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 16</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 33 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 06 LDA #6
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 20 xx xx JSR @rts15× 2</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts14</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 20 xx xx JSR @rts15× 2</pre>||Clobbers Z&N, and V; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @zptemp, @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, @rts15, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts12× 2</pre>||Requires @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP \ × 2
| |
| 28 PLP /
| |
| 08 PHP
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 85 xx STA @zptemp
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 82 LDY #130 ;hides 'NOP #imm'
| |
| 04 EA NOP $EA ;hides 'NOP'
| |
| 88 DEY
| |
| 30 FA BMI *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| 48 PHA
| |
| 68 ... PLA × 5
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, and Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| E6 xx INC @zptemp
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 15
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 15
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 15
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 15
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 15
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 34 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| 00 00... BRK 0 × 2</pre>||Clobbers A, S, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 00 LDA #0
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 00 LDA #0
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| F6 F6 INC $F6,X
| |
| 00 00... BRK 0 × 2</pre>||Clobbers Z&N; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 00 00 BRK 0
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 2
| |
| 00 00... BRK 0 × 2</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 20 xx xx JSR @rts14× 2</pre>||Clobbers Z&N; requires @zptemp, @rts12, @rts14, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 4
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 20 xx xx JSR @rts14× 2</pre>||Clobbers S; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 18 CLC
| |
| 10 FC BPL *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 17</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 35 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 08 LDA #8
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A2 F8 LDX #248 ;hides 'SED'
| |
| E8 ... INX × 2
| |
| D0 FB BNE *-3</pre>||Clobbers X, Z&N, and D
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 88 ... DEY × 2
| |
| 30 FB BMI *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts14× 2</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 20 xx xx JSR @rts15× 2</pre>||Clobbers Z&N; requires @zptemp, @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 20 xx xx JSR @rts15× 2</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 16
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 16
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 16
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 16
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 16
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 36 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 18 CLC
| |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 02 LDA #2
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 02 LDA #2
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 2</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA NOP
| |
| 90 FC BCC *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA NOP
| |
| 90 FC BCC *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 04 LDX #4
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 20 xx xx JSR @rts15× 2</pre>||Clobbers Z&N; requires @zptemp, @rts12, @rts15, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts14
| |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| C5 C5 CMP $C5
| |
| 28 PLP
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 20 xx xx JSR @rts15× 2</pre>||Clobbers S; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 05 LDX #5
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12× 3</pre>||Requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 7A LDY #122 ;hides 'NOP'
| |
| EA NOP
| |
| C8 ... INY × 2
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 85 xx STA @zptemp
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| EA NOP
| |
| 68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 18</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 37 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #10
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A2 04 LDX #4
| |
| 68 PLA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 03 LDY #3
| |
| 68 PLA
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 04 LDX #4
| |
| EA ... NOP × 2
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 03 LDY #3
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 03 LDA #3
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 03 LDA #3
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 09 LDA #$09 ;hides 'ORA #$EA'
| |
| EA NOP ;first loop only
| |
| 00 00 BRK 0
| |
| 10 FA BPL *-4</pre>||Clobbers A, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts14× 2</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 ... CLC × 2
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 17
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 17
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 17
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 17
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 17
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 38 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 0B LDA #11
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 00 00... BRK 0 × 2</pre>||Requires dummy interrupt handler, and @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 ... PLA × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 7A LDY #122 ;hides 'NOP'
| |
| EA NOP
| |
| C8 ... INY × 2
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 04 LDX #4
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 19</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 39 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 05 LDA #5
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 05 LDA #5
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 ... DEY × 2
| |
| 30 FB BMI *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 05 LDX #5 ;hides 'ORA zp'
| |
| CA DEX ;first loop only
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 05 LDY #5 ;hides 'ORA zp'
| |
| 88 DEY ;first loop only
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 05 LDX #5
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15
| |
| 20 xx xx JSR @rts12× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| AA TAX
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 8C TXA
| |
| 28 PLP</pre>||Clobbers X; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A8 TAY
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 98 TYA
| |
| 28 PLP</pre>||Clobbers Y; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 7A LDX #122 ;hides 'NOP'
| |
| EA NOP
| |
| E8 ... INX × 2
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers X; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 7A LDY #122 ;hides 'NOP'
| |
| EA NOP
| |
| C8 ... INY × 2
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers Y; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 04 LDX #4
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 04 LDX #4
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 03 LDY #3
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 20 xx xx JSR @rts14× 2</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 20 xx xx JSR @rts12× 3</pre>||Clobbers S; requires @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 03 LDY #3
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 18
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 18
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 18
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 18
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 18
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 40 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 0D LDA #13
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 05 LDX #5 ;hides 'ORA zp'
| |
| EA NOP
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>A0 05 LDY #5 ;hides 'ORA zp'
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 06 LDA #6
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 06 LDA #6
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00... BRK 0 × 2
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>00 00... BRK 0 × 2
| |
| 08 PHP \ × 2
| |
| 28 PLP /</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|14 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 20</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 41 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 03 LDY #3
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts14
| |
| 20 xx xx JSR @rts15</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 00 LDA #0
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 ... DEY × 2
| |
| 30 FB BMI *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 19
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 19
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 19
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 19
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 19
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 42 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 0F LDA #15
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 05 LDX #5 ;hides 'ORA zp'
| |
| EA NOP
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 05 LDY #5 ;hides 'ORA zp'
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A2 07 LDX #7
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 08 LDA #8
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 08 LDA #8
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 00 00... BRK 0 × 3</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 F8 LDX #248 ;hides 'SED'
| |
| E8 ... INX × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 ... DEY × 2
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 00 00... BRK 0 × 3</pre>||Clobbers Z&N, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 00 00... BRK 0 × 3</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00... BRK 0 × 2
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>20 xx xx JSR @rts14× 3</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 01 LDA #1
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00... BRK 0 × 2
| |
| 08 PHP \ × 2
| |
| 28 PLP /</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 21</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 43 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 10 LDA #16
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 18 CLC
| |
| 10 FC BPL *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15
| |
| 20 xx xx JSR @rts14× 2</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 02 LDA #2
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA NOP
| |
| 90 FC BCC *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 03 LDY #3
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|15 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 20
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 20
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 20
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 20
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 20
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 44 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 11 LDA #17
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 88 DEY
| |
| 30 FB BMI *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #10
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #10
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 00 00... BRK 0 × 3</pre>||Clobbers Z&N; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 00 00... BRK 0 × 3</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 04 LDX #4
| |
| EA ... NOP × 2
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 03 LDY #3
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts14
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 03 LDA #3
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 09 LDA #$09 ;hides 'ORA #$EA'
| |
| EA NOP ;first loop only
| |
| 00 00 BRK 0
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| 90 00 BCC *+2
| |
| 00 00... BRK 0 × 3</pre>||Clobbers C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>B8 CLV
| |
| 50 00 BVC *+2
| |
| 00 00... BRK 0 × 3</pre>||Clobbers V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 85 xx STA @zptemp
| |
| 00 00... BRK 0 × 3</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 00 00... BRK 0 × 2
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| F6 F6 INC $F6,X
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts14× 3</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts12
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 00 00... BRK 0 × 2
| |
| 08 PHP \ × 2
| |
| 28 PLP /</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 22</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 45 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 12 LDA #18
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0B LDA #11
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0B LDA #11
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| 10 FC BPL *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 00 00... BRK 0 × 3</pre>||Clobbers Z&N; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 00 00... BRK 0 × 3</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 21
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 21
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 21
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 21
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 21
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 46 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 09 LDX #9
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 13 LDA #19
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 07 LDX #7
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 05 LDA #5
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 ... DEY × 2
| |
| 30 FB BMI *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 20 xx xx JSR @rts14
| |
| 20 xx xx JSR @rts15× 2</pre>||Requires @rts12, @rts14, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| B0 FC BCS *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 23</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 47 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 14 LDA #20
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>BA TSX
| |
| 68 PLA
| |
| 9A TXS
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, Z&N, and C; and unsafe for interrupts
| |
| |-
| |
| |<pre>A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>EA NOP
| |
| F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0D LDA #13
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0D LDA #13
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 88 DEY
| |
| 30 FC BMI *-2</pre>||Clobbers Y, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>AA TAX
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 8C TXA</pre>||Clobbers X, S, Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A8 TAY
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 98 TYA</pre>||Clobbers Y, S, Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 05 LDX #5 ;hides 'ORA zp'
| |
| EA NOP
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 05 LDY #5 ;hides 'ORA zp'
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 06 LDA #6
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 2
| |
| 20 xx xx JSR @rts14</pre>||Requires dummy interrupt handler, @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 2
| |
| 00 00... BRK 0 × 3</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 90 FD BCC *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 22
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 22
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 22
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 22
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 22
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 48 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 15 LDA #21
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 88 DEY
| |
| 30 FB BMI *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 85 xx STA @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|16 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 24</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 49 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 16 LDA #22
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 PHA
| |
| 90 FC BCC *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| 48 PHA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 24 24 BIT $24
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 85 xx STA @zptemp
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0F LDA #15
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0F LDA #15
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 04 04 NOP $04
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 ... PLA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 07 LDX #7
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 08 LDA #8
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 3</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 23
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 23
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 23
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 23
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 23
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 50 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 17 LDA #23
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 07 LDY #7
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 10 LDA #16
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 10 LDA #16
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 06 LDX #6
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 88 DEY
| |
| 30 FB BMI *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|17 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 25</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 51 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 11 LDA #17
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 11 LDA #17
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 3
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 88 DEY
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #10
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 00 00... BRK 0 × 3</pre>||Requires dummy interrupt handler, and @rts12; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 85 xx STA @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 10 FD BPL *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| EA NOP
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| 10 FC BPL *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 24
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 24
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 24
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 24
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 24
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 52 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 19 LDA #25
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| EA NOP
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 06 LDX #6
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 12 LDA #18
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 12 LDA #18
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 PHA
| |
| 90 FC BCC *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>00 00... BRK 0 × 4</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0B LDA #11
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| 10 FC BPL *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 26</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 53 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 1A LDA #26
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 13 LDA #19
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 13 LDA #19
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 ... PLA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 4
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 25
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 25
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 25
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 25
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 25
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 54 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 1B LDA #27
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 ... PHA × 2
| |
| 10 FB BPL *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 68 PLA
| |
| 88 DEY
| |
| 30 FB BMI *-3</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 14 LDA #20
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 14 LDA #20
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 07 LDY #7
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| BA TSX
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 9A TXS
| |
| 28 PLP</pre>||Clobbers A, and X; writes in stack; and unsafe for interrupts
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| EA NOP
| |
| F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0D LDA #13
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00... BRK 0 × 4</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 3
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 2
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A2 08 LDX #8
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|18 bytes
| |
| |-
| |
| |<pre>36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 27</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 55 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 F8 LDX #248 ;hides 'SED'
| |
| E8 INX
| |
| D0 FC BNE *-2</pre>||Clobbers X, Z&N, and D
| |
| |-
| |
| |<pre>A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, Z&N, and D
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| 68 PLA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 05 LDY #5
| |
| 68 PLA
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 05 LDY #5
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 15 LDA #21
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 15 LDA #21
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 26
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 26
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 26
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 26
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 26
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 56 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 1D LDA #29
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| |<pre>A9 2A LDA #$2A ;hides 'ROL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 16 LDA #22
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 16 LDA #22
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 90 FB BCC *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 24 24 BIT $24
| |
| 90 FB BCC *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 06 LDX #6
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0F LDA #15
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 07 LDY #7
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|19 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 28</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 57 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 1E LDA #30
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>A2 08 LDX #8
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 08 LDY #8
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 17 LDA #23
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 17 LDA #23
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 8C TXA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 06 LDX #6
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 07 LDY #7
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 10 LDA #16
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 27
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 27
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 27
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 27
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 27
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 58 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 1F LDA #31
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 EB LDA #$EB ;hides 'SBC #$1A'
| |
| 1A NOP ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 8C TXA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>20 xx xx JSR @rts12
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 11 LDA #17
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 29</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 59 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 20 LDA #32
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 F8 LDX #248 ;hides 'SED'
| |
| E8 INX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, Z&N, and D
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, S, Z&N, and D
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 ... SEC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 38 SEC
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, Z&N, and D
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 19 LDA #25
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 19 LDA #25
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 8C TXA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| AA TAX</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| EA NOP
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| EA NOP
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 8C TXA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 06 LDX #6
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 12 LDA #18
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 09 LDY #9
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 86 xx STX @zptemp
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 4</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 28
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 28
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 28
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 28
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 28
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 60 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 21 LDA #33
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 1A LDA #26
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 1A LDA #26
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 13 LDA #19
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 28 PLP
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|20 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 30</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 61 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 22 LDA #34
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| E6 xx INC @zptemp
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 1B LDA #27
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 1B LDA #27
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 08 LDY #8
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| E6 xx INC @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and D; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 14 LDA #20
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 07 LDY #7
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 86 xx STX @zptemp
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| EA NOP
| |
| F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 00 00... BRK 0 × 4</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 ... PHA × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 05 LDY #5
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 29
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 29
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 29
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 29
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 29
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 62 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 88 LDX #136 ;hides 'DEY'
| |
| CA DEX
| |
| 30 FC BMI *-2</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A9 23 LDA #35
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1</pre>||Clobbers Y, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 F8 LDX #248 ;hides 'SED'
| |
| E8 INX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| A2 F8 LDX #248 ;hides 'SED'
| |
| E8 INX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, Z&N, and D
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, Z&N, and D
| |
| |-
| |
| |<pre>A2 0B LDX #11
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 09 LDX #9
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 15 LDA #21
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A4 xx LDY @zptemp
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| D0 FD BNE *-1
| |
| 28 PLP
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|21 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 31</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 63 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 24 LDA #36
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0B LDA #11
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 4C xx xx JMP *+3
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and not relocatable code
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 1D LDA #29
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 1D LDA #29
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, S, Z&N, and D
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| E6 xx INC @zptemp
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 16 LDA #22
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 08 LDY #8
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 24 24 BIT $24
| |
| 90 FB BCC *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 30
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 30
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 30
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 30
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 30
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 64 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 25 LDA #37
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 09 LDX #9
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA ... NOP × 2
| |
| B0 FA BCS *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 1E LDA #30
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 1E LDA #30
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 ... PHA × 2
| |
| 38 SEC
| |
| 10 FA BPL *-4</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 4
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 08 LDX #8
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 08 LDY #8
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 17 LDA #23
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 32</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 65 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 26 LDA #38
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 PHA
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A2 08 LDX #8
| |
| 48 PHA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>A0 08 LDY #8
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 1F LDA #31
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 1F LDA #31
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 EB LDA #$EB ;hides 'SBC #$1A'
| |
| 1A NOP ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 EB LDA #$EB ;hides 'SBC #$1A'
| |
| 1A NOP ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 31
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 31
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 31
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 31
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 31
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 66 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 27 LDA #39
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 20 LDA #32
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 20 LDA #32
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 08 LDA #8
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and D; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 4
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 F8 LDY #248 ;hides 'SED'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, Z&N, and D
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 19 LDA #25
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| D0 FD BNE *-1
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$EA'
| |
| EA NOP ;first loop only
| |
| EA NOP
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|22 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 33</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 67 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 28 LDA #40
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>C5 CD CMP <$CD ;hides 'CMP $F9A2'
| |
| A2 F9 LDX #249
| |
| E8 INX
| |
| D0 FA BNE *-4</pre>||Clobbers X, Z&N, and C
| |
| |-
| |
| |<pre>24 2C BIT <$2C ;hides 'BIT $07A2'
| |
| A2 07 LDX #7
| |
| CA DEX
| |
| D0 FA BNE *-4</pre>||Clobbers X, Z&N, and V
| |
| |-
| |
| |<pre>A5 AD LDA <$AD ;hides 'LDA $07A2'
| |
| A2 07 LDX #7
| |
| CA DEX
| |
| D0 FA BNE *-4</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>C5 CD CMP <$CD ;hides 'CMP $07A0'
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FA BNE *-4</pre>||Clobbers Y, Z&N, and C
| |
| |-
| |
| |<pre>24 2C BIT <$2C ;hides 'BIT $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, Z&N, and V
| |
| |-
| |
| |<pre>A5 AD LDA <$AD ;hides 'LDA $F9A0'
| |
| A0 F9 LDY #249
| |
| C8 INY
| |
| D0 FA BNE *-4</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A4 AC LDY <$AC ;hides 'LDY $06A2'
| |
| A2 06 LDX #6
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| F6 F6 INC $F6,X
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>A0 05 LDY #5
| |
| F6 F6 INC $F6,X
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 21 LDA #33
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 21 LDA #33
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>04 0C NOP <$0C ;hides 'NOP $79A2'
| |
| A2 79 LDX #121
| |
| E8 INX
| |
| 10 FA BPL *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>04 0C NOP <$0C ;hides 'NOP $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A2 06 LDX #6
| |
| 48 ... PHA × 2
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 05 LDY #5
| |
| 48 ... PHA × 2
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 09 LDX #9
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 1A LDA #26
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 32
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 32
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 32
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 32
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 32
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 68 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 29 LDA #41
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0D LDA #13
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 22 LDA #34
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 22 LDA #34
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 1B LDA #27
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 3
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 84 xx STY @zptemp
| |
| A0 08 LDY #8
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|23 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 34</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 69 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, Z&N, and C
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 2A LDA #42
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 38 SEC
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 88 LDX #136 ;hides 'DEY'
| |
| CA DEX
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers X, and Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 23 LDA #35
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 23 LDA #35
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| 28 PLP</pre>||Clobbers Y; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 33
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 33
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 33
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 33
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 33
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 70 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 2B LDA #43
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 24 LDA #36
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 24 LDA #36
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0B LDA #11
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 4C xx xx JMP *+3
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; writes in stack; and not relocatable code
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0B LDA #11
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 1D LDA #29
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 ... CLC × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| E6 xx INC @zptemp
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 30 FC BMI *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 30 FD BMI *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 35</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 71 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 2C LDA #44
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 25 LDA #37
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 25 LDA #37
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 09 LDX #9
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA ... NOP × 2
| |
| B0 FA BCS *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA ... NOP × 2
| |
| B0 FA BCS *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| 24 2C BIT <$2C ;hides 'BIT $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, Z&N, and V
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 1E LDA #30
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| 04 0C NOP <$0C ;hides 'NOP $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 34
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 34
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 34
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 34
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 34
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 72 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 2D LDA #45
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, Z&N, and C
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A2 0D LDX #13
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 26 LDA #38
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 26 LDA #38
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 88 LDX #136 ;hides 'DEY'
| |
| CA DEX
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers X, Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 08 LDX #8
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 08 LDY #8
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 1F LDA #31
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 EB LDA #$EB ;hides 'SBC #$1A'
| |
| 1A NOP ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|24 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 36</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 73 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 2E LDA #46
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 27 LDA #39
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 27 LDA #39
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 20 LDA #32
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| C5 CD CMP <$CD ;hides 'CMP $07A0'
| |
| A0 07 LDY #7
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| 24 2C BIT <$2C ;hides 'BIT $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and V; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| 04 0C NOP <$0C ;hides 'NOP $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 09 LDX #9
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 35
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 35
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 35
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 35
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 35
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 74 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 2F LDA #47
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 28 LDA #40
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 28 LDA #40
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 24 2C BIT <$2C ;hides 'BIT $07A2'
| |
| A2 07 LDX #7
| |
| CA DEX
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 24 2C BIT <$2C ;hides 'BIT $06A0'
| |
| A0 06 LDY #6
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| F6 F6 INC $F6,X
| |
| 90 FB BCC *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| F6 F6 INC $F6,X
| |
| 90 FB BCC *-3
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 21 LDA #33
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|25 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 37</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 75 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 30 LDA #48
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 29 LDA #41
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 29 LDA #41
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 22 LDA #34
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 09 LDY #9
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 36
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 36
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 36
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 36
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 36
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 76 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 31 LDA #49
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| 30 FC BMI *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2A LDA #42
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2A LDA #42
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 38 SEC
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 38 SEC
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 23 LDA #35
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 18 CLC
| |
| D0 FC BNE *-2
| |
| 28 PLP
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 38</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 77 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 32 LDA #50
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A2 0E LDX #14
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2B LDA #43
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2B LDA #43
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 03 xx SLO (@ptrtemp,X)</pre>||Clobbers A, X, Z&N, and C; and requires @ptrtemp, and support for unofficial opcodes
| |
| |-
| |
| |<pre>A0 0A LDY #10 ;hides 'ASL A'
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 13 xx SLO (@ptrtemp,Y)</pre>||Clobbers A, Y, Z&N, and C; and requires @ptrtemp, and support for unofficial opcodes
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 24 LDA #36
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0B LDA #11
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 37
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 37
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 37
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 37
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 37
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 78 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 33 LDA #51
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0A LDX #10
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| 30 FC BMI *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0F LDA #15
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2C LDA #44
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2C LDA #44
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 25 LDA #37
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| EA ... NOP × 2
| |
| B0 FA BCS *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|26 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 39</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 79 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 34 LDA #52
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 48 PHA
| |
| 30 FC BMI *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 85 xx STA @zptemp
| |
| 30 FB BMI *-3</pre>||Clobbers Y, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 04 04 NOP $04
| |
| 30 FB BMI *-3</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| 18 CLC
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2D LDA #45
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2D LDA #45
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 4C xx xx JMP *+3
| |
| 18 CLC
| |
| D0 F9 BNE *-5</pre>||Clobbers A, Z&N, and C; and not relocatable code
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 26 LDA #38
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 38
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 38
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 38
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 38
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 38
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 80 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 35 LDA #53
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 88 LDX #136 ;hides 'DEY'
| |
| EA NOP
| |
| CA DEX
| |
| 30 FB BMI *-3</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| 30 FC BMI *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2E LDA #46
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2E LDA #46
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 27 LDA #39
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 08 LDA #8
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|27 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 40</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 81 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 36 LDA #54
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 48 PHA
| |
| 30 FB BMI *-3</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| E6 xx INC @zptemp
| |
| 90 FA BCC *-4</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 2F LDA #47
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 2F LDA #47
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 48 PHA
| |
| 18 CLC
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 85 xx STA @zptemp
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 20 xx xx JSR @rts15
| |
| 90 FA BCC *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 04 04 NOP $04
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA NOP
| |
| 00 00 BRK 0
| |
| 90 FA BCC *-4</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 4C xx xx JMP *+3
| |
| 18 CLC
| |
| D0 F9 BNE *-5</pre>||Clobbers A, Z&N, and C; and not relocatable code
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 28 LDA #40
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| F6 F6 INC $F6,X
| |
| 90 FB BCC *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 39
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 39
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 39
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 39
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 39
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 82 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 37 LDA #55
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 09 LDX #9
| |
| 68 PLA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 48 PHA
| |
| 30 FC BMI *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 09 LDY #9
| |
| 68 PLA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A2 09 LDX #9
| |
| EA ... NOP × 2
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 09 LDY #9
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 30 LDA #48
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 30 LDA #48
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| 18 CLC
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 29 LDA #41
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 41</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 83 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 38 LDA #56
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, V, and D
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 10 LDA #16
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 31 LDA #49
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 31 LDA #49
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 48 PHA
| |
| 30 FC BMI *-2
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 85 xx STA @zptemp
| |
| 30 FB BMI *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 04 04 NOP $04
| |
| 30 FB BMI *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2A LDA #42
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| E6 xx INC @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 38 SEC
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, C, and V; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X
| |
| 76 36 ROR $36,X
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 40
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 40
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 40
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 40
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 40
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 84 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 39 LDA #57
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts12
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 32 LDA #50
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 32 LDA #50
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| 30 FC BMI *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| E6 xx INC @zptemp
| |
| 28 PLP
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2B LDA #43
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 03 xx SLO (@ptrtemp,X)
| |
| 28 PLP</pre>||Clobbers A, and X; requires @ptrtemp, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0A LDY #10 ;hides 'ASL A'
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 13 xx SLO (@ptrtemp,Y)
| |
| 28 PLP</pre>||Clobbers A, and Y; requires @ptrtemp, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A2 0D LDX #13
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|28 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 42</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 85 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 3A LDA #58
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 33 LDA #51
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 33 LDA #51
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0A LDX #10
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0F LDA #15
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0F LDA #15
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2C LDA #44
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 48 PHA
| |
| 30 FC BMI *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 04 04 NOP $04
| |
| 30 FB BMI *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 41
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 41
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 41
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 41
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 41
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 86 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 3B LDA #59
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 34 LDA #52
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 34 LDA #52
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, V, and D
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 85 xx STA @zptemp
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts12
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 04 04 NOP $04
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers Y; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 48 PHA
| |
| 30 FC BMI *-2
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 09 LDY #9
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 85 xx STA @zptemp
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2D LDA #45
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 04 04 NOP $04
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|29 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 43</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 87 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 3C LDA #60
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 ... PHA × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A2 F8 LDX #248 ;hides 'SED'
| |
| 68 PLA
| |
| E8 INX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, S, Z&N, and D
| |
| |-
| |
| |<pre>A0 F8 LDY #248 ;hides 'SED'
| |
| 68 PLA
| |
| C8 INY
| |
| D0 FB BNE *-3</pre>||Clobbers A, Y, S, Z&N, and D
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 3
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 0C LDX #12
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 35 LDA #53
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 35 LDA #53
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 88 LDX #136 ;hides 'DEY'
| |
| EA NOP
| |
| CA DEX
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers X, and Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 0E LDX #14
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2E LDA #46
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 42
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 42
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 42
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 42
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 42
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 88 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 3D LDA #61
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, V, and D
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 10 LDA #16
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 36 LDA #54
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 36 LDA #54
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| E6 xx INC @zptemp
| |
| 90 FA BCC *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| E6 xx INC @zptemp
| |
| 90 FA BCC *-4
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 2F LDA #47
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 85 xx STA @zptemp
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 20 xx xx JSR @rts15
| |
| 90 FA BCC *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 04 04 NOP $04
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| EA NOP
| |
| 00 00 BRK 0
| |
| 90 FA BCC *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 48 PHA
| |
| 30 FC BMI *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA ... NOP × 2
| |
| 08 PHP
| |
| 28 PLP
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 09 LDY #9
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 44</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 89 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 3E LDA #62
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0A LDX #10 ;hides 'ASL A'
| |
| EA NOP
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, Z&N, and C
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| EA ... NOP × 2
| |
| 30 FB BMI *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>A2 0A LDX #10
| |
| 48 PHA
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| F6 F6 INC $F6,X
| |
| 90 FA BCC *-4</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 37 LDA #55
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 37 LDA #55
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 ... PHA × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 09 LDX #9
| |
| EA ... NOP × 2
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 09 LDY #9
| |
| EA ... NOP × 2
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 30 LDA #48
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 43
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 43
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 43
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 43
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 43
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 90 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 3F LDA #63
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 38 LDA #56
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 38 LDA #56
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 10 LDA #16
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 31 LDA #49
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 85 xx STA @zptemp
| |
| 30 FB BMI *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 04 04 NOP $04
| |
| 30 FB BMI *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| E6 xx INC @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA NOP
| |
| 30 FC BMI *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|30 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 45</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 91 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 40 LDA #64
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA ... NOP × 2
| |
| 30 FA BMI *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 39 LDA #57
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 39 LDA #57
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 ... PHA × 2
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 3
| |
| D0 FA BNE *-4</pre>||Clobbers A, S, Z&N, and C
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 10 LDX #16
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts12
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts12
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 32 LDA #50
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| E6 xx INC @zptemp
| |
| 28 PLP
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 08 LDA #8
| |
| EA ... NOP × 2
| |
| E9 01 SBC #1
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 44
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 44
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 44
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 44
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 44
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 92 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 41 LDA #65
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 3A LDA #58
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 3A LDA #58
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, V, and D
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3</pre>||Clobbers A, S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 33 LDA #51
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0F LDA #15
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|31 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 46</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 93 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 42 LDA #66
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 3B LDA #59
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 3B LDA #59
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3</pre>||Clobbers A, S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA ... NOP × 2
| |
| 30 FB BMI *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 34 LDA #52
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts12
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 10 LDA #16
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 ... PHA × 2
| |
| D0 FB BNE *-3
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, and C; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 45
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 45
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 45
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 45
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 45
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 94 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 43 LDA #67
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 3C LDA #60
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 3C LDA #60
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP \ × 2
| |
| 28 PLP /
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 3
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 3
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 0C LDX #12
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 35 LDA #53
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 47</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 95 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 44 LDA #68
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 3D LDA #61
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 3D LDA #61
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 10 LDA #16
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 36 LDA #54
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA ... NOP × 2
| |
| 30 FB BMI *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| E6 xx INC @zptemp
| |
| 90 FA BCC *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| B8 CLV
| |
| 50 00 BVC *+2
| |
| D0 FA BNE *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 2
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 46
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 46
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 46
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 46
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 46
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 96 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 45 LDA #69
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 3E LDA #62
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 3E LDA #62
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0A LDX #10 ;hides 'ASL A'
| |
| EA NOP
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA ... NOP × 2
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0A LDX #10
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| F6 F6 INC $F6,X
| |
| 90 FA BCC *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| F6 F6 INC $F6,X
| |
| 90 FA BCC *-4
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 37 LDA #55
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|32 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 48</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 97 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 46 LDA #70
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| 48 PHA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 48 PHA
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A2 08 LDX #8
| |
| 08 PHP
| |
| 28 PLP
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| C5 C5 CMP $C5
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, Z&N, and C
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, Z&N, and V
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| A5 A5 LDA $A5
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>A0 08 LDY #8
| |
| 08 PHP
| |
| 28 PLP
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers Y, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, Z&N, and C
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, Z&N, and V
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| A5 A5 LDA $A5
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| A4 A4 LDY $A4
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| 85 xx STA @zptemp
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 85 xx STA @zptemp
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 3F LDA #63
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 3F LDA #63
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| 04 04 NOP $04
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| 10 FB BPL *-3</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 38 LDA #56
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 47
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 47
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 47
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 47
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|50 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 47
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 98 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 47 LDA #71
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 40 LDA #64
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 40 LDA #64
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA ... NOP × 2
| |
| 30 FA BMI *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA ... NOP × 2
| |
| 30 FA BMI *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 39 LDA #57
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts12
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A4 xx LDY @zptemp
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 2
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 04 04 NOP $04
| |
| 30 FA BMI *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 08 LDA #8
| |
| EA ... NOP × 2
| |
| E9 01 SBC #1
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|33 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 49</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 99 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 48 LDA #72
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0D LDX #13
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 41 LDA #65
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 41 LDA #65
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 38 SEC
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 3A LDA #58
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A, and S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|50 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 48
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 48
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 48
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 48
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|51 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 48
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 100 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 49 LDA #73
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0A LDX #10
| |
| 68 PLA
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 68 PLA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 42 LDA #66
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 42 LDA #66
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 3B LDA #59
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| EA ... NOP × 2
| |
| 30 FB BMI *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|50 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 50</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 101 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 4A LDA #74
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 43 LDA #67
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 43 LDA #67
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA NOP
| |
| 48 PHA
| |
| 30 FA BMI *-4</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 18 CLC
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| 48 PHA
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 08 LDY #8
| |
| 08 PHP
| |
| 28 PLP
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A8 TAY</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A8 TAY</pre>||Clobbers A, Z&N, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| 85 xx STA @zptemp
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 3C LDA #60
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0B LDY #11
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP \ × 2
| |
| 28 PLP /
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| EA ... NOP × 3
| |
| D0 FA BNE *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|51 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 49
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 49
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 49
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 49
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|52 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 49
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 102 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 4B LDA #75
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>C9 CD CMP #<$CD ;hides 'CMP $F5A2'
| |
| A2 F5 LDX #245
| |
| E8 INX
| |
| D0 FA BNE *-4</pre>||Clobbers X, Z&N, and C
| |
| |-
| |
| |<pre>A2 2C LDX #<$2C ;hides 'BIT $8AA2'
| |
| A2 8A LDX #138
| |
| CA DEX
| |
| 30 FA BMI *-4</pre>||Clobbers X, Z&N, and V
| |
| |-
| |
| |<pre>A9 AD LDA #<$AD ;hides 'LDA $F5A2'
| |
| A2 F5 LDX #245
| |
| E8 INX
| |
| D0 FA BNE *-4</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>C9 CD CMP #<$CD ;hides 'CMP $F5A0'
| |
| A0 F5 LDY #245
| |
| C8 INY
| |
| D0 FA BNE *-4</pre>||Clobbers Y, Z&N, and C
| |
| |-
| |
| |<pre>A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4</pre>||Clobbers Y, Z&N, and V
| |
| |-
| |
| |<pre>A9 AD LDA #<$AD ;hides 'LDA $F5A0'
| |
| A0 F5 LDY #245
| |
| C8 INY
| |
| D0 FA BNE *-4</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A0 AC LDY #<$AC ;hides 'LDY $0AA2'
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A2 8D LDX #<$8D ;hides 'STA $0AA2'
| |
| A2 0A LDX #10
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers X, and Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>A2 8D LDX #<$8D ;hides 'STA $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| D0 FA BNE *-4</pre>||Clobbers X, and Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>A0 8D LDY #<$8D ;hides 'STA $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>A0 8D LDY #<$8D ;hides 'STA $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4</pre>||Clobbers Y, and Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 44 LDA #68
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 44 LDA #68
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>80 0C NOP #<$0C ;hides 'NOP $F5A2'
| |
| A2 F5 LDX #245
| |
| E8 INX
| |
| D0 FA BNE *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>80 0C NOP #<$0C ;hides 'NOP $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 0D LDX #13
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 3D LDA #61
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|34 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|51 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 51</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 103 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 4C LDA #76
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 69 LDA #$69 ;hides 'ADC #$08'
| |
| 08 PHP ;first loop only
| |
| 90 FC BCC *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 45 LDA #69
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 45 LDA #69
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 ... PHA × 2
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 3E LDA #62
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and V; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 69 LDA #$69 ;hides 'ADC #$18'
| |
| 18 CLC ;first loop only
| |
| F6 F6 INC $F6,X
| |
| 90 FA BCC *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0B LDY #11
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0B LDY #11
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 84 xx STY @zptemp
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|52 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 50
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 50
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 50
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 50
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|53 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 50
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 104 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 4D LDA #77
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 46 LDA #70
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 46 LDA #70
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 48 PHA
| |
| 00 00 BRK 0
| |
| 10 FA BPL *-4</pre>||Clobbers A, S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 38 SEC
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 85 xx STA @zptemp
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 04 04 NOP $04
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0B LDY #11
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 3F LDA #63
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|35 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|52 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 52</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 105 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 4E LDA #78
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| 48 PHA
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>A0 0D LDY #13
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 47 LDA #71
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 47 LDA #71
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 40 LDA #64
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA ... NOP × 2
| |
| 30 FA BMI *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|53 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 51
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 51
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 51
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 51
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|54 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 51
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 106 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 4F LDA #79
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| EA NOP
| |
| 30 FB BMI *-3</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 48 LDA #72
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 48 LDA #72
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0D LDX #13
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 ... PHA × 2
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| C9 CD CMP #<$CD ;hides 'CMP $F5A0'
| |
| A0 F5 LDY #245
| |
| C8 INY
| |
| D0 FA BNE *-4
| |
| A8 TAY</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY</pre>||Clobbers A, Z&N, and V
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 8D LDY #<$8D ;hides 'STA $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 8D LDY #<$8D ;hides 'STA $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 41 LDA #65
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| 80 0C NOP #<$0C ;hides 'NOP $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 38 SEC
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 38 SEC
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|53 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 53</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 107 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 50 LDA #80
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 18 LDX #24 ;hides 'CLC'
| |
| CA ... DEX × 2
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 18 LDY #24 ;hides 'CLC'
| |
| 88 ... DEY × 2
| |
| D0 FB BNE *-3</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 49 LDA #73
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 49 LDA #73
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 18 CLC
| |
| A9 69 LDA #$69 ;hides 'ADC #$08'
| |
| 08 PHP ;first loop only
| |
| 90 FC BCC *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 42 LDA #66
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 3
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|54 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 52
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 52
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 52
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 52
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|55 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 52
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 108 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 51 LDA #81
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 14 LDA #20
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #74
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #74
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 43 LDA #67
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 18 CLC
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 08 LDY #8
| |
| 08 PHP
| |
| 28 PLP
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| C9 CD CMP #<$CD ;hides 'CMP $F5A0'
| |
| A0 F5 LDY #245
| |
| C8 INY
| |
| D0 FA BNE *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and V; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 8D LDY #<$8D ;hides 'STA $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $200-$2FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 8D LDY #<$8D ;hides 'STA $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $300-$3FF
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| 80 0C NOP #<$0C ;hides 'NOP $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 0D LDX #13
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|36 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|54 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 54</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 109 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 52 LDA #82
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A2 0C LDX #12
| |
| 68 PLA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 0B LDY #11
| |
| 68 PLA
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4B LDA #75
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4B LDA #75
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 90 FB BCC *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| EA NOP
| |
| 30 FB BMI *-3</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 38 SEC
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 74 LDA #116 ;hides 'NOP zp,X'
| |
| EA NOP
| |
| 69 01 ADC #1
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 2C LDX #<$2C ;hides 'BIT $8AA2'
| |
| A2 8A LDX #138
| |
| CA DEX
| |
| 30 FA BMI *-4
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 44 LDA #68
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|55 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 53
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 53
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 53
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 53
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|56 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 53
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 110 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 53 LDA #83
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4C LDA #76
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4C LDA #76
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 45 LDA #69
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 0E LDY #14
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|37 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|55 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 55</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 111 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4D LDA #77
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4D LDA #77
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| 88 ... DEY × 2
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 13 LDX #19
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 46 LDA #70
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 38 SEC
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 38 SEC
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 85 xx STA @zptemp
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 85 xx STA @zptemp
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 04 04 NOP $04
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 04 04 NOP $04
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0D LDY #13
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|56 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 54
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 54
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 54
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 54
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|57 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 54
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 112 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 55 LDA #85
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>C5 CD CMP <$CD ;hides 'CMP $74A2'
| |
| A2 74 LDX #116
| |
| E8 INX
| |
| 10 FA BPL *-4</pre>||Clobbers X, Z&N, and C
| |
| |-
| |
| |<pre>24 2C BIT <$2C ;hides 'BIT $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers X, Z&N, and V
| |
| |-
| |
| |<pre>A5 AD LDA <$AD ;hides 'LDA $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>C5 CD CMP <$CD ;hides 'CMP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, Z&N, and C
| |
| |-
| |
| |<pre>24 2C BIT <$2C ;hides 'BIT $74A0'
| |
| A0 74 LDY #116
| |
| C8 INY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, Z&N, and V
| |
| |-
| |
| |<pre>A5 AD LDA <$AD ;hides 'LDA $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A6 AE LDX <$AE ;hides 'LDX $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A2 15 LDX #21
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4E LDA #78
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4E LDA #78
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>04 0C NOP <$0C ;hides 'NOP $8BA2'
| |
| A2 8B LDX #139
| |
| CA DEX
| |
| 30 FA BMI *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>04 0C NOP <$0C ;hides 'NOP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0D LDY #13
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 47 LDA #71
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|56 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 56</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 113 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 56 LDA #86
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 10 LDX #16
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4F LDA #79
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4F LDA #79
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 48 LDA #72
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| 88 ... DEY × 2
| |
| D0 FB BNE *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| C9 CD CMP #<$CD ;hides 'CMP $F5A0'
| |
| A0 F5 LDY #245
| |
| C8 INY
| |
| D0 FA BNE *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 8D LDY #<$8D ;hides 'STA $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires writable $200-$2FF; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 8D LDY #<$8D ;hides 'STA $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires writable $300-$3FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| 80 0C NOP #<$0C ;hides 'NOP $0AA0'
| |
| A0 0A LDY #10
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 38 SEC
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 ... SEC × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 8
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|57 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 55
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 55
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 55
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 55
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|58 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 55
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 114 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 57 LDA #87
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 50 LDA #80
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 50 LDA #80
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 18 LDX #24 ;hides 'CLC'
| |
| CA ... DEX × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| 88 ... DEY × 2
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 49 LDA #73
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|38 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|57 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 57</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 115 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 58 LDA #88
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 51 LDA #81
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 51 LDA #81
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 14 LDA #20
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 14 LDA #20
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #74
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 0D LDA #13
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|58 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 56
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 56
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 56
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 56
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|59 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 56
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 116 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 52 LDA #82
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 52 LDA #82
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| C5 CD CMP <$CD ;hides 'CMP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>8C TXA
| |
| 24 2C BIT <$2C ;hides 'BIT $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| 10 FA BPL *-4
| |
| AA TAX</pre>||Clobbers A, Z&N, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 15 LDX #21
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4B LDA #75
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| 04 0C NOP <$0C ;hides 'NOP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 90 FB BCC *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 90 FB BCC *-3
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 38 SEC
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 38 SEC
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 74 LDA #116 ;hides 'NOP zp,X'
| |
| EA NOP
| |
| 69 01 ADC #1
| |
| 10 F9 BPL *-5
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 74 LDA #116 ;hides 'NOP zp,X'
| |
| EA NOP
| |
| 69 01 ADC #1
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|39 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|58 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 58</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 117 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 5A LDA #90
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A2 0D LDX #13 ;hides 'ORA abs'
| |
| A5 A5 LDA $A5
| |
| CA DEX
| |
| D0 FA BNE *-4</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>A0 0D LDY #13 ;hides 'ORA abs'
| |
| A5 A5 LDA $A5
| |
| 88 DEY
| |
| D0 FA BNE *-4</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 53 LDA #83
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 53 LDA #83
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A2 0C LDX #12 ;hides 'NOP abs'
| |
| 44 00 NOP $0
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A0 0C LDY #12 ;hides 'NOP abs'
| |
| 44 00 NOP $0
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 14 LDX #20
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4C LDA #76
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|59 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 57
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 57
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 57
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 57
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|60 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 57
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 118 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 5B LDA #91
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4D LDA #77
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| 88 ... DEY × 2
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| C5 CD CMP <$CD ;hides 'CMP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| 24 2C BIT <$2C ;hides 'BIT $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| 10 FA BPL *-4
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N, and V; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| 04 0C NOP <$0C ;hides 'NOP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| 38 SEC
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 85 xx STA @zptemp
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 04 04 NOP $04
| |
| 00 00 BRK 0
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$5A'
| |
| 5A NOP ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|59 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 59</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 119 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 5C LDA #92
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A0 88 LDY #136 ;hides 'DEY'
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 FB BMI *-3</pre>||Clobbers Y, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 55 LDA #85
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 55 LDA #85
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 48 PHA
| |
| 08 PHP
| |
| 28 PLP
| |
| D0 FA BNE *-4</pre>||Clobbers A, S, Z&N, and C; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| C5 C5 CMP $C5
| |
| 28 PLP
| |
| D0 F9 BNE *-5</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 24 2C BIT <$2C ;hides 'BIT $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| C5 CD CMP <$CD ;hides 'CMP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4E LDA #78
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 4
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|60 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 58
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 58
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 58
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 58
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|61 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 58
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 120 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 5D LDA #93
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 56 LDA #86
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 56 LDA #86
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 10 LDX #16
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4F LDA #79
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 2A LDA #$2A ;hides 'ROL A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 84 xx STY @zptemp
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| 88 ... DEY × 2
| |
| D0 FB BNE *-3
| |
| A4 xx LDY @zptemp
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 13 LDA #19
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 2C LDY #<$2C ;hides 'BIT $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|40 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|60 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 60</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 121 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 5E LDA #94
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 FA BMI *-4</pre>||Clobbers A, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 57 LDA #87
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 57 LDA #87
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 90 FA BCC *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA NOP
| |
| 00 00 BRK 0
| |
| 90 FA BCC *-4</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 50 LDA #80
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 0C LDY #12 ;hides 'NOP abs'
| |
| 44 00 NOP $0
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| 28 PLP
| |
| 18 CLC
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 13 LDY #19
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|61 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 59
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 59
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 59
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 59
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|62 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 59
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 122 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 5F LDA #95
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3</pre>||Clobbers A, Z&N, C, V, and D
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 11 LDX #17
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 58 LDA #88
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 58 LDA #88
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 51 LDA #81
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 14 LDA #20
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|41 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|61 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 61</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 123 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 60 LDA #96
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 17 LDA #23
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 52 LDA #82
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| C5 CD CMP <$CD ;hides 'CMP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| 24 2C BIT <$2C ;hides 'BIT $0BA2'
| |
| A2 0B LDX #11
| |
| CA DEX
| |
| 10 FA BPL *-4
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 15 LDX #21
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| 04 0C NOP <$0C ;hides 'NOP $0BA0'
| |
| A0 0B LDY #11
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 0C LDY #12 ;hides 'NOP abs'
| |
| 44 00 NOP $0
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00 BRK 0
| |
| 90 FB BCC *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| EA NOP
| |
| 68 PLA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 38 SEC
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 74 LDA #116 ;hides 'NOP zp,X'
| |
| EA NOP
| |
| 69 01 ADC #1
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 0D LDY #13
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|62 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 60
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 60
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 60
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 60
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|63 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 60
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 124 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|4 bytes
| |
| |-
| |
| |<pre>A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 61 LDA #97
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 5A LDA #90
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 5A LDA #90
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0D LDX #13 ;hides 'ORA abs'
| |
| A5 A5 LDA $A5
| |
| CA DEX
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A, and X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0D LDY #13 ;hides 'ORA abs'
| |
| A5 A5 LDA $A5
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A, and Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 53 LDA #83
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 0C LDX #12 ;hides 'NOP abs'
| |
| 44 00 NOP $0
| |
| CA DEX
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers X; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 0C LDY #12 ;hides 'NOP abs'
| |
| 44 00 NOP $0
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers Y; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|62 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 62</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 125 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 62 LDA #98
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 1A LDX #26 ;hides 'NOP'
| |
| CA ... DEX × 2
| |
| 10 FB BPL *-3</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A0 1A LDY #26 ;hides 'NOP'
| |
| 88 ... DEY × 2
| |
| 10 FB BPL *-3</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 5B LDA #91
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 5B LDA #91
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 9
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 2
| |
| 66 26 ROR $26 /
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|63 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 61
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 61
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 61
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 61
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|64 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 61
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 126 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 63 LDA #99
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 5C LDA #92
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 5C LDA #92
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 88 LDY #136 ;hides 'DEY'
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 FB BMI *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00 BRK 0
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 ... PLA × 2
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 16 LDX #22
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 55 LDA #85
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| C5 C5 CMP $C5
| |
| 28 PLP
| |
| D0 F9 BNE *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|42 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|63 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 63</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 127 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 64 LDA #100
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 5D LDA #93
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 5D LDA #93
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 00 00 BRK 0
| |
| B0 FA BCS *-4</pre>||Clobbers A, Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 11 LDX #17
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 56 LDA #86
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|64 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 62
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 62
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 62
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 62
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|65 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 62
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 128 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 65 LDA #101
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 5E LDA #94
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 5E LDA #94
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 FA BMI *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 FA BMI *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 57 LDA #87
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts15
| |
| 90 FA BCC *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| EA NOP
| |
| 00 00 BRK 0
| |
| 90 FA BCC *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|43 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|64 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 64</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 129 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 66 LDA #102
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A2 10 LDX #16
| |
| 48 PHA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 10 LDY #16
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 5F LDA #95
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 5F LDA #95
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2</pre>||Clobbers A, Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1A LDY #26 ;hides 'NOP'
| |
| 88 ... DEY × 2
| |
| 10 FB BPL *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 11 LDX #17
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 58 LDA #88
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|65 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 63
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 63
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 63
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 63
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|66 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 63
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 130 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 67 LDA #103
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 60 LDA #96
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 60 LDA #96
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|65 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 65</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 131 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 68 LDA #104
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 61 LDA #97
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 61 LDA #97
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 5A LDA #90
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 1A LDY #26 ;hides 'NOP'
| |
| 88 ... DEY × 2
| |
| 10 FB BPL *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| F6 F6 INC $F6,X
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 10 LDY #16
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 5
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|66 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 64
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 64
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 64
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 64
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|67 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 64
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 132 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 69 LDA #105
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 03 xx SLO (@ptrtemp,X)</pre>||Clobbers A, X, Z&N, and C; and requires @ptrtemp, and support for unofficial opcodes
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>BA TSX
| |
| 68 PLA
| |
| 9A TXS
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, and Z&N; and unsafe for interrupts
| |
| |-
| |
| |<pre>A2 19 LDX #25
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 62 LDA #98
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 62 LDA #98
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>AA TAX
| |
| 68 PLA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1A LDX #26 ;hides 'NOP'
| |
| CA ... DEX × 2
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers X; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 1A LDY #26 ;hides 'NOP'
| |
| 88 ... DEY × 2
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers Y; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 17 LDX #23
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 5B LDA #91
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|44 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|66 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 66</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 133 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 6A LDA #106
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 19 LDA #25
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 63 LDA #99
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 63 LDA #99
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 10 LDY #16
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 5C LDA #92
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00 BRK 0
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00 BRK 0
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|67 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 65
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 65
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 65
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 65
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|68 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 65
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 134 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 6B LDA #107
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 13 LDX #19
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 64 LDA #100
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 64 LDA #100
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 11 LDX #17
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 20 xx xx JSR @rts14
| |
| B0 F9 BCS *-5</pre>||Clobbers A, Z&N, C, and V; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 5D LDA #93
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 00 00 BRK 0
| |
| B0 FA BCS *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 00 00 BRK 0
| |
| B0 FA BCS *-4
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 16 LDY #22
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|45 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|67 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 67</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 135 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 6C LDA #108
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 65 LDA #101
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 65 LDA #101
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 5E LDA #94
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 FA BMI *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 26 26... ROL $26 × 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|68 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 66
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 66
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 66
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 66
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|69 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 66
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 136 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 6D LDA #109
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 66 LDA #102
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 66 LDA #102
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| EA ... NOP × 2
| |
| 30 FA BMI *-4</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| E6 xx INC @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>68 ... PLA × 2
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 10 LDX #16
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 10 LDY #16
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 19 LDX #25
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 5F LDA #95
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1A LDY #26 ;hides 'NOP'
| |
| 88 ... DEY × 2
| |
| 10 FB BPL *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| EA NOP
| |
| B0 FB BCS *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|68 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 68</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 137 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 6E LDA #110
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| 48 PHA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| C5 C5 CMP $C5
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, Z&N, and C
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, Z&N, and V
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| A5 A5 LDA $A5
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers Y, Z&N, and C
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers Y, Z&N, and V
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| A5 A5 LDA $A5
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| A4 A4 LDY $A4
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| 85 xx STA @zptemp
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| 85 xx STA @zptemp
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers Y, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 67 LDA #103
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 67 LDA #103
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| 04 04 NOP $04
| |
| CA DEX
| |
| D0 FB BNE *-3</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| D0 FB BNE *-3</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 13 LDX #19
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 60 LDA #96
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 17 LDA #23
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 10
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|69 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 67
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 67
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 67
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 67
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|70 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 67
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 138 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 6F LDA #111
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 1B LDA #27
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 68 LDA #104
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 68 LDA #104
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 61 LDA #97
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| AA TAX
| |
| 68 PLA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers S, and Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|46 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|69 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 69</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 139 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 70 LDA #112
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 69 LDA #105
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 69 LDA #105
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 48 PHA
| |
| B0 FB BCS *-3</pre>||Clobbers A, S, Z&N, C, V, and D; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 85 xx STA @zptemp
| |
| B0 FA BCS *-4</pre>||Clobbers A, Z&N, C, V, and D; and requires @zptemp
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 04 04 NOP $04
| |
| B0 FA BCS *-4</pre>||Clobbers A, Z&N, C, V, and D; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 03 xx SLO (@ptrtemp,X)
| |
| 28 PLP</pre>||Clobbers A, and X; requires @ptrtemp, and support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| BA TSX
| |
| 68 PLA
| |
| 9A TXS
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers A, and X; writes in stack; and unsafe for interrupts
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 19 LDX #25
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 62 LDA #98
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A2 18 LDX #24
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|70 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 68
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 68
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 68
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 68
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|71 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 68
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 140 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 71 LDA #113
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 6A LDA #106
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 6A LDA #106
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 19 LDA #25
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 19 LDA #25
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 63 LDA #99
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp
| |
| 28 PLP</pre>||Clobbers S; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>20 xx xx JSR @rts15
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 00 00 BRK 0
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 17 LDA #23
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|47 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|70 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 70</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 141 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 72 LDA #114
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 6B LDA #107
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 6B LDA #107
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 F9 BMI *-5</pre>||Clobbers A, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 13 LDX #19
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX</pre>||Clobbers A, and Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, Z&N, and V
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| 85 xx STA @zptemp
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 64 LDA #100
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 11 LDY #17
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 20 xx xx JSR @rts14
| |
| B0 F9 BCS *-5
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 20 xx xx JSR @rts14
| |
| B0 F9 BCS *-5
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 00 00 BRK 0
| |
| B0 FA BCS *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>EA NOP
| |
| FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>4C xx xx JMP *+3
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and not relocatable code
| |
| |-
| |
| !colspan="2"|71 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 69
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 69
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 69
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 69
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|72 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 69
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 142 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 73 LDA #115
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A2 18 LDX #24 ;hides 'CLC'
| |
| EA NOP
| |
| CA ... DEX × 2
| |
| 10 FA BPL *-4</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 6C LDA #108
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 6C LDA #108
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 1A LDX #26
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 65 LDA #101
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 11
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|71 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 71</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 143 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 74 LDA #116
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 6D LDA #109
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 6D LDA #109
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| F6 F6 INC $F6,X
| |
| 28 PLP
| |
| D0 F9 BNE *-5</pre>||Clobbers A, Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 66 LDA #102
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 86 xx STX @zptemp
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 19 LDX #25
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and V; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 11 LDY #17
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| B0 FC BCS *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| D0 FA BNE *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 13 LDX #19
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| C5 C5 CMP $C5
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and C
| |
| |-
| |
| |<pre>EA NOP
| |
| 24 24 BIT $24
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N, and V
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 26 26 ROL $26
| |
| 66 26 ROR $26
| |
| 36 36 ROL $36,X \ × 6
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>EA NOP
| |
| 04 04 NOP $04
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|72 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 70
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 70
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 70
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 70
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|73 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 70
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 144 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 75 LDA #117
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 6E LDA #110
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 6E LDA #110
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp, support for unofficial opcodes, and writable $00-$FF
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 08 PHP
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 11 LDX #17
| |
| 24 24 BIT $24
| |
| CA DEX
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 11 LDY #17
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 67 LDA #103
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|48 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 12
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|72 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 72</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 145 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 76 LDA #118
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| 48 PHA
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A2 10 LDX #16
| |
| 68 PLA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>A0 12 LDY #18
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 10 LDY #16
| |
| 68 PLA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 6F LDA #111
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 6F LDA #111
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 1B LDA #27
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 1B LDA #27
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 68 LDA #104
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>FE 00 02 INC $0200,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $200-$2FF
| |
| |-
| |
| |<pre>FE 00 03 INC $0300,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $300-$3FF
| |
| |-
| |
| |<pre>FE 00 04 INC $0400,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $400-$4FF
| |
| |-
| |
| |<pre>FE 00 05 INC $0500,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $500-$5FF
| |
| |-
| |
| |<pre>FE 00 06 INC $0600,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $600-$6FF
| |
| |-
| |
| |<pre>FE 00 07 INC $0700,X
| |
| 36 36 ROL $36,X \ × 7
| |
| 76 36 ROR $36,X /
| |
| 36 36... ROL $36,X× 9</pre>||Clobbers Z&N; and requires writable $700-$7FF
| |
| |-
| |
| !colspan="2"|73 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 71
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 71
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 71
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 71
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|74 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 71
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 146 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 77 LDA #119
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 70 LDA #112
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 70 LDA #112
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 69 LDA #105
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 85 xx STA @zptemp
| |
| B0 FA BCS *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, V, and D; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 85 xx STA @zptemp
| |
| B0 FA BCS *-4
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 04 04 NOP $04
| |
| B0 FA BCS *-4
| |
| 68 PLA</pre>||Clobbers Z&N, C, V, and D; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 04 04 NOP $04
| |
| B0 FA BCS *-4
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 10 LDA #16
| |
| 24 24 BIT $24
| |
| E9 01 SBC #1
| |
| 10 F9 BPL *-5
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|49 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 36 36 ROL $36,X \ × 12
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|73 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 73</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 147 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 78 LDA #120
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>C9 CD CMP #<$CD ;hides 'CMP $70A2'
| |
| A2 70 LDX #112
| |
| E8 INX
| |
| 10 FA BPL *-4</pre>||Clobbers X, Z&N, and C
| |
| |-
| |
| |<pre>A2 2C LDX #<$2C ;hides 'BIT $F0A2'
| |
| A2 F0 LDX #240
| |
| E8 INX
| |
| D0 FA BNE *-4</pre>||Clobbers X, Z&N, and V
| |
| |-
| |
| |<pre>A9 AD LDA #<$AD ;hides 'LDA $70A2'
| |
| A2 70 LDX #112
| |
| E8 INX
| |
| 10 FA BPL *-4</pre>||Clobbers A, X, and Z&N
| |
| |-
| |
| |<pre>C9 CD CMP #<$CD ;hides 'CMP $10A0'
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FA BNE *-4</pre>||Clobbers Y, Z&N, and C
| |
| |-
| |
| |<pre>A0 2C LDY #<$2C ;hides 'BIT $F0A0'
| |
| A0 F0 LDY #240
| |
| C8 INY
| |
| D0 FA BNE *-4</pre>||Clobbers Y, Z&N, and V
| |
| |-
| |
| |<pre>A9 AD LDA #<$AD ;hides 'LDA $0FA0'
| |
| A0 0F LDY #15
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers A, Y, and Z&N
| |
| |-
| |
| |<pre>A2 AE LDX #<$AE ;hides 'LDX $0FA0'
| |
| A0 0F LDY #15
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers X, Y, and Z&N
| |
| |-
| |
| |<pre>A2 1C LDX #28
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>A2 8D LDX #<$8D ;hides 'STA $0FA2'
| |
| A2 0F LDX #15
| |
| CA DEX
| |
| 10 FA BPL *-4</pre>||Clobbers X, and Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>A0 8D LDY #<$8D ;hides 'STA $0FA0'
| |
| A0 0F LDY #15
| |
| 88 DEY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 71 LDA #113
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 71 LDA #113
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>80 0C NOP #<$0C ;hides 'NOP $F0A2'
| |
| A2 F0 LDX #240
| |
| E8 INX
| |
| D0 FA BNE *-4</pre>||Clobbers X, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>80 0C NOP #<$0C ;hides 'NOP $70A0'
| |
| A0 70 LDY #112
| |
| C8 INY
| |
| 10 FA BPL *-4</pre>||Clobbers Y, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 6A LDA #106
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 19 LDA #25
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|74 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 72
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 72
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 72
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 72
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|75 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 72
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 148 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 79 LDA #121
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A2 14 LDX #20
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$9A'
| |
| 9A TXS ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 72 LDA #114
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 72 LDA #114
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 6B LDA #107
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 F9 BMI *-5
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 F9 BMI *-5
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| 48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| C5 C5 CMP $C5
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 24 24 BIT $24
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and V; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 11 LDY #17
| |
| 04 04 NOP $04
| |
| 88 DEY
| |
| D0 FB BNE *-3
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 12 LDY #18
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$2A'
| |
| 2A ROL A ;first loop only
| |
| 20 xx xx JSR @rts14
| |
| B0 F9 BCS *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| 8C TXA
| |
| A2 E8 LDX #232 ;hides 'INX'
| |
| D0 FD BNE *-1
| |
| AA TAX
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 19 LDY #25
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|74 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 74</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 149 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 7A LDA #122
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 73 LDA #115
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 73 LDA #115
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V; and requires @zptemp, support for unofficial opcodes, and writable $00-$FF
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 18 LDX #24 ;hides 'CLC'
| |
| EA NOP
| |
| CA ... DEX × 2
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 6C LDA #108
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|75 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 73
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 73
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 73
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 73
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|76 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 73
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 150 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 7B LDA #123
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 74 LDA #116
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 74 LDA #116
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 6D LDA #109
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP
| |
| F6 F6 INC $F6,X
| |
| 28 PLP
| |
| D0 F9 BNE *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 12 LDA #18
| |
| EA NOP
| |
| E9 01 SBC #1
| |
| 10 FA BPL *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|60 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 15
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|75 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 75</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 151 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 1E LDX #30
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 7C LDA #124
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 20 xx xx JSR @rts14
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 75 LDA #117
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 75 LDA #117
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 18 CLC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$9A'
| |
| 9A TXS ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP \ × 2
| |
| 28 PLP /
| |
| D0 F9 BNE *-5</pre>||Clobbers A, Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 18 CLC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$9A'
| |
| 9A TXS ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| C9 CD CMP #<$CD ;hides 'CMP $10A0'
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A8 TAY</pre>||Clobbers A, Z&N, and C
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 2C LDY #<$2C ;hides 'BIT $F0A0'
| |
| A0 F0 LDY #240
| |
| C8 INY
| |
| D0 FA BNE *-4
| |
| A8 TAY</pre>||Clobbers A, Z&N, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 1C LDX #28
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 8D LDY #<$8D ;hides 'STA $0FA0'
| |
| A0 0F LDY #15
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires writable $700-$7FF
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 6E LDA #110
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>98 TYA
| |
| 80 0C NOP #<$0C ;hides 'NOP $70A0'
| |
| A0 70 LDY #112
| |
| C8 INY
| |
| 10 FA BPL *-4
| |
| A8 TAY</pre>||Clobbers A, and Z&N; and requires support for unofficial opcodes
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp, support for unofficial opcodes, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, support for unofficial opcodes, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 12 LDY #18
| |
| 48 PHA
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers S, and Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1A LDY #26
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|76 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 74
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 74
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 74
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 74
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|77 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 74
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 152 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 7D LDA #125
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X</pre>||Clobbers X, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 76 LDA #118
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 76 LDA #118
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 18 CLC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$9A'
| |
| 9A TXS ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 1B LDX #27
| |
| CA DEX
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 6F LDA #111
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 1B LDA #27
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|76 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 76</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 153 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A2 EA LDX #234 ;hides 'NOP'
| |
| E8 INX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 EA LDY #234 ;hides 'NOP'
| |
| C8 INY
| |
| D0 FC BNE *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 7E LDA #126
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$08'
| |
| 08 PHP ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 1D LDA #29
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 77 LDA #119
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 77 LDA #119
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 70 LDA #112
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 08 PHP
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>C5 C5 CMP $C5
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| C9 CD CMP #<$CD ;hides 'CMP $10A0'
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and C; and requires @zptemp
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 2C LDY #<$2C ;hides 'BIT $F0A0'
| |
| A0 F0 LDY #240
| |
| C8 INY
| |
| D0 FA BNE *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N, and V; and requires @zptemp
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 8D LDY #<$8D ;hides 'STA $0FA0'
| |
| A0 0F LDY #15
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $700-$7FF
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| 80 0C NOP #<$0C ;hides 'NOP $70A0'
| |
| A0 70 LDY #112
| |
| C8 INY
| |
| 10 FA BPL *-4
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 85 xx STA @zptemp
| |
| B0 FA BCS *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 69 LDA #$69 ;hides 'ADC #$F8'
| |
| F8 SED ;first loop only
| |
| 04 04 NOP $04
| |
| B0 FA BCS *-4
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 10 LDA #16
| |
| 24 24 BIT $24
| |
| E9 01 SBC #1
| |
| 10 F9 BPL *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|77 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 75
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 75
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 75
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 75
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|78 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 75
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 154 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 7F LDA #127
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A2 11 LDX #17
| |
| 68 PLA
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>A0 11 LDY #17
| |
| 68 PLA
| |
| 88 DEY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| D0 FD BNE *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 78 LDA #120
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 78 LDA #120
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>A9 0A LDA #$0A ;hides 'ASL A'
| |
| 00 00... BRK 0 × 2
| |
| 10 F9 BPL *-5</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>68 PLA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 2C LDX #<$2C ;hides 'BIT $F0A2'
| |
| A2 F0 LDX #240
| |
| E8 INX
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| C9 CD CMP #<$CD ;hides 'CMP $10A0'
| |
| A0 10 LDY #16
| |
| 88 DEY
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 71 LDA #113
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|77 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 77</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 155 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 80 LDA #128
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA NOP
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 16 LDX #22
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 79 LDA #121
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 79 LDA #121
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 14 LDX #20
| |
| EA NOP
| |
| CA DEX
| |
| 10 FC BPL *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 72 LDA #114
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>E6 xx INC @zptemp
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, and dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$0A'
| |
| 0A ASL A ;first loop only
| |
| EA NOP
| |
| 08 PHP
| |
| 28 PLP
| |
| 30 F9 BMI *-5
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|78 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 76
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 76
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 76
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 76
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|79 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 76
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 156 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 69 LDA #$69 ;hides 'ADC #$38'
| |
| 38 SEC ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A2 1E LDX #30
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 7A LDA #122
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 7A LDA #122
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>00 00 BRK 0
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A6 A6 LDX $A6
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A4 A4 LDY $A4
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>8C TXA
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX</pre>||Clobbers A, and Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 73 LDA #115
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>EA NOP
| |
| 68 PLA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires @zptemp, support for unofficial opcodes, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, support for unofficial opcodes, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A; requires @zptemp, dummy interrupt handler, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA</pre>||Clobbers S, Z&N, C, and V; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers A, and S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA</pre>||Clobbers S, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 28 PLP</pre>||Clobbers A, and S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA NOP
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|52 bytes
| |
| |-
| |
| |<pre>36 36 ROL $36,X \ × 13
| |
| 76 36 ROR $36,X /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|78 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 78</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 157 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 82 LDA #130
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 EA LDX #234 ;hides 'NOP'
| |
| E8 INX
| |
| D0 FC BNE *-2</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 EA LDY #234 ;hides 'NOP'
| |
| C8 INY
| |
| D0 FC BNE *-2</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 EA LDY #234 ;hides 'NOP'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 16 LDX #22
| |
| EA NOP
| |
| CA DEX
| |
| D0 FC BNE *-2</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 7B LDA #123
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 7B LDA #123
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 74 LDA #116
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|79 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 77
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 77
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 77
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 77
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|80 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 77
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 158 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 83 LDA #131
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>18 CLC
| |
| A9 69 LDA #$69 ;hides 'ADC #$38'
| |
| 38 SEC ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>EA NOP
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>EA NOP
| |
| A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 7C LDA #124
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 7C LDA #124
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1D LDY #29
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 20 xx xx JSR @rts14
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 20 xx xx JSR @rts14
| |
| D0 FA BNE *-4
| |
| 28 PLP</pre>||Clobbers A; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 75 LDA #117
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP \ × 2
| |
| 28 PLP /
| |
| D0 F9 BNE *-5
| |
| 68 PLA</pre>||Clobbers Z&N, and C; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 08 PHP \ × 2
| |
| 28 PLP /
| |
| D0 F9 BNE *-5
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 2C LDY #<$2C ;hides 'BIT $F0A0'
| |
| A0 F0 LDY #240
| |
| C8 INY
| |
| D0 FA BNE *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 8C TXA
| |
| A2 1C LDX #28
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| AA TAX
| |
| 68 PLA</pre>||Clobbers Z&N; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 8D LDY #<$8D ;hides 'STA $0FA0'
| |
| A0 0F LDY #15
| |
| 88 DEY
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires writable $700-$7FF; and writes in stack
| |
| |-
| |
| |<pre>F6 F6 INC $F6,X
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp, and writable $00-$FF
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| 80 0C NOP #<$0C ;hides 'NOP $70A0'
| |
| A0 70 LDY #112
| |
| C8 INY
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 3
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>85 xx STA @zptemp
| |
| 68 PLA
| |
| 18 CLC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$9A'
| |
| 9A TXS ;first loop only
| |
| D0 FC BNE *-2
| |
| A5 xx LDA @zptemp</pre>||Clobbers S, Z&N, C, and V; and requires @zptemp
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 84 xx STY @zptemp
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| F6 F6 INC $F6,X
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires @zptemp, support for unofficial opcodes, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 E9 LDA #$E9 ;hides 'SBC #$3A'
| |
| 3A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| 08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1B LDY #27
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|79 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 79</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
| | |
| === 159 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 84 LDA #132
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 69 LDA #$69 ;hides 'ADC #$38'
| |
| 38 SEC ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, S, and Z&N; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>A5 A5 LDA $A5
| |
| A9 69 LDA #$69 ;hides 'ADC #$38'
| |
| 38 SEC ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, Z&N, C, and V
| |
| |-
| |
| |<pre>A6 A6 LDX $A6
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>A4 A4 LDY $A4
| |
| A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 20 xx xx JSR @rts15
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; requires @rts12, and @rts15; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 7D LDA #125
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 7D LDA #125
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| 18 CLC
| |
| D0 FA BNE *-4</pre>||Clobbers A, Z&N, and C; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|8 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| 10 FC BPL *-2
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>84 xx STY @zptemp
| |
| A0 EA LDY #234 ;hides 'NOP'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| A4 xx LDY @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| F6 xx INC @zptemp,X
| |
| 28 PLP</pre>||Clobbers X; requires @zptemp; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| F6 F6 INC $F6,X
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; requires @zptemp, and writable $00-$FF; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 76 LDA #118
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X, and S; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y, and S; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 98 TYA
| |
| A0 15 LDY #21
| |
| EA NOP
| |
| 88 DEY
| |
| D0 FC BNE *-2
| |
| A8 TAY
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A2 1D LDX #29
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 3
| |
| 08 PHP
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| D0 FD BNE *-1
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|80 bytes
| |
| |-
| |
| |<pre>18 ... CLC × 78
| |
| 90 00 BCC *+2</pre>||Clobbers C
| |
| |-
| |
| |<pre>B8 ... CLV × 78
| |
| 50 00 BVC *+2</pre>||Clobbers V
| |
| |-
| |
| |<pre>EA ... NOP × 78
| |
| 85 xx STA @zptemp</pre>||Requires @zptemp
| |
| |-
| |
| |<pre>EA ... NOP × 78
| |
| 04 04 NOP $04</pre>||Requires support for unofficial opcodes
| |
| |-
| |
| !colspan="2"|81 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 78
| |
| 4C xx xx JMP *+3</pre>||Not relocatable code
| |
| |-
| |
| |}
| |
| | |
| | |
| === 160 cycles ===
| |
| {| class="wikitable testtable"
| |
| !colspan="2"|5 bytes
| |
| |-
| |
| |<pre>A9 85 LDA #133
| |
| 20 xx xx JSR delay_a_25_clocks</pre>||Clobbers A, Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|6 bytes
| |
| |-
| |
| |<pre>68 PLA
| |
| A9 69 LDA #$69 ;hides 'ADC #$38'
| |
| 38 SEC ;first loop only
| |
| D0 FC BNE *-2</pre>||Clobbers A, S, Z&N, C, and V
| |
| |-
| |
| |<pre>68 PLA
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers A, X, S, and Z&N
| |
| |-
| |
| |<pre>68 PLA
| |
| A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers A, Y, S, and Z&N
| |
| |-
| |
| !colspan="2"|7 bytes
| |
| |-
| |
| |<pre>98 TYA
| |
| A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY</pre>||Clobbers A, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A2 EA LDX #234 ;hides 'NOP'
| |
| E8 INX
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers X; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| 10 FD BPL *-1</pre>||Clobbers X, and Z&N
| |
| |-
| |
| |<pre>08 PHP
| |
| A0 EA LDY #234 ;hides 'NOP'
| |
| C8 INY
| |
| D0 FC BNE *-2
| |
| 28 PLP</pre>||Clobbers Y; and writes in stack
| |
| |-
| |
| |<pre>EA ... NOP × 2
| |
| A0 1E LDY #30
| |
| 88 DEY
| |
| 10 FD BPL *-1</pre>||Clobbers Y, and Z&N
| |
| |-
| |
| |<pre>48 PHA
| |
| A9 7E LDA #126
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| A9 7E LDA #126
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 28 PLP</pre>||Clobbers A; requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|9 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 1D LDA #29
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 68 PLA</pre>||Clobbers Z&N, C, and V; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 38 SEC
| |
| A9 1D LDA #29
| |
| E9 01 SBC #1
| |
| 10 FB BPL *-3
| |
| 28 PLP</pre>||Clobbers A; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A9 77 LDA #119
| |
| 20 xx xx JSR delay_a_25_clocks
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires delay_a_25_clocks; and writes in stack
| |
| |-
| |
| !colspan="2"|10 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| 38 SEC
| |
| A9 0A LDA #$0A ;hides 'ASL A'
| |
| 20 xx xx JSR @rts14
| |
| D0 FA BNE *-4
| |
| 68 PLA</pre>||Clobbers Z&N, and C; requires @rts12, and @rts14; and writes in stack
| |
| |-
| |
| |<pre>48 ... PHA × 2
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers S, and Z&N; and writes in stack
| |
| |-
| |
| !colspan="2"|11 bytes
| |
| |-
| |
| |<pre>48 PHA
| |
| A5 A5 LDA $A5
| |
| 98 TYA
| |
| A0 1C LDY #28
| |
| 88 DEY
| |
| 10 FD BPL *-1
| |
| A8 TAY
| |
| 68 PLA</pre>||Clobbers Z&N; and writes in stack
| |
| |-
| |
| |<pre>86 xx STX @zptemp
| |
| A6 A6 LDX $A6
| |
| A2 1E LDX #30
| |
| CA DEX
| |
| D0 FD BNE *-1
| |
| A6 xx LDX @zptemp</pre>||Clobbers Z&N; and requires @zptemp
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| !colspan="2"|12 bytes
| |
| |-
| |
| |<pre>04 04 NOP $04
| |
| 08 PHP
| |
| 48 PHA
| |
| 18 CLC
| |
| A9 EB LDA #$EB ;hides 'SBC #$7A'
| |
| 7A NOP ;first loop only
| |
| D0 FC BNE *-2
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires support for unofficial opcodes; and writes in stack
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| A5 A5 LDA $A5
| |
| A9 4A LDA #$4A ;hides 'LSR A'
| |
| 00 00 BRK 0
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Requires dummy interrupt handler; and writes in stack
| |
| |-
| |
| |<pre>48 PHA
| |
| 08 PHP
| |
| 48 PHA
| |
| 38 SEC
| |
| A9 1C LDA #28
| |
| E9 01 SBC #1
| |
| D0 FB BNE *-3
| |
| 68 PLA
| |
| 28 PLP</pre>||Clobbers S; and writes in stack
| |
| |-
| |
| !colspan="2"|13 bytes
| |
| |-
| |
| |<pre>08 PHP
| |
| 48 PHA
| |
| 98 TYA
| |
| A0 18 LDY #24 ;hides 'CLC'
| |
| EA NOP
| |
| 88 ... DEY × 2
| |
| 10 FA BPL *-4
| |
| A8 TAY
| |
| 68 PLA
| |
| 28 PLP</pre>||Writes in stack
| |
| |-
| |
| !colspan="2"|64 bytes
| |
| |-
| |
| |<pre>26 26 ROL $26 \ × 16
| |
| 66 26 ROR $26 /</pre>||Clobbers Z&N
| |
| |-
| |
| !colspan="2"|80 bytes
| |
| |-
| |
| |<pre>EA ... NOP × 80</pre>||No requirements
| |
| |-
| |
| |}
| |
| | |
|
| |
|
| == See also == | | == See also == |
|
| |
|
| | * [[Cycle counting]] |
| * [[Delay code]] for functions that produce runtime-determined amount of delay | | * [[Delay code]] for functions that produce runtime-determined amount of delay |
| * Bisqwit's 6502 delay_n macro set for ca65: http://bisqwit.iki.fi/src/6502-inline_delay.7z | | * Bisqwit’s “vending machine” for producing a ca65-compatible delay_n macro for arbitrary number of cycles, with more fine-grained configurable constraints: http://bisqwit.iki.fi/utils/nesdelay.php The samples on this page are excerpts from files generated by this online tool. |