We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

CPX: Difference between revisions

From SnesLab
Jump to: navigation, search
Line 69: Line 69:
* snes9x implementation of CPX: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L402
* snes9x implementation of CPX: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L402
* undisbeliever on CPX: https://undisbeliever.net/snesdev/65816-opcodes.html#cpx-compare-index-register-x-with-memory
* undisbeliever on CPX: https://undisbeliever.net/snesdev/65816-opcodes.html#cpx-compare-index-register-x-with-memory
* http://www.6502.org/tutorials/6502opcodes.html#CPX
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#CPX


[[Category:ASM]]
[[Category:ASM]]
[[Category:Group Three Instructions]]
[[Category:Group Three Instructions]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]

Revision as of 07:13, 21 July 2024

Basic Info
Addressing Mode Opcode Length Speed
Immediate E0 2/3 bytes 2 cycles*
Absolute EC 3 bytes 4 cycles*
Direct Page E4 2 bytes 3 cycles*
Flags Affected
N V M X D I Z C
. . . . .

CPX (Compare X) is a 65x instruction that compares the value of the X index register. Internally, this is done via a subtraction, but the difference is not stored anywhere. The contents at the effective address and the X index register both remain unchanged.

CPX assumes its operands are unsigned.

Syntax

CPX #const
CPX addr
CPX dp

See Also

External Links