We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
CMP (Super FX): Difference between revisions
From SnesLab
(→See Also: SBC) |
(→See Also: ALT3) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
|'''Cache Speed''' | |'''Cache Speed''' | ||
|+ | |+ | ||
|[[Implied]] | |[[Implied]] (type 1) | ||
|3F6n | |3F6n | ||
|2 bytes | |2 bytes | ||
Line 40: | Line 40: | ||
The operand serves as the subtrahend and can be any register from R<sub>0</sub> to R<sub>15</sup>. | The operand serves as the subtrahend and can be any register from R<sub>0</sub> to R<sub>15</sup>. | ||
==== Syntax ==== | |||
<pre> | |||
CMP Rn | |||
</pre> | |||
=== See Also === | === See Also === | ||
Line 45: | Line 50: | ||
* [[SUB]] | * [[SUB]] | ||
* [[SBC]] | * [[SBC]] | ||
* [[ALT3]] | |||
=== External Links === | === External Links === |
Latest revision as of 00:08, 6 July 2024
Basic Info | |||||||
---|---|---|---|---|---|---|---|
Addressing Mode | Opcode | Length | ROM Speed | RAM Speed | Cache Speed | ||
Implied (type 1) | 3F6n | 2 bytes | 6 cycles | 6 cycles | 2 cycles |
Flags Affected | ||||||||
---|---|---|---|---|---|---|---|---|
B | ALT1 | ALT2 | O/V | S | CY | Z | ||
0 | 0 | 0 |
CMP (Compare) is a Super FX instruction that compares the operand register with the source register. Internally, this is done via a subtraction, but the difference is not stored anywhere. Thus, the purpose of CMP is to setup the flags.
The operand serves as the subtrahend and can be any register from R0 to R15.
Syntax
CMP Rn
See Also
External Links
- Official Nintendo documentation on CMP: 9.29 on page 2-9-41 of Book II