We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
INC (SPC700): Difference between revisions
From SnesLab
(created page) |
(made flags affected more prominent) |
||
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{| class="wikitable" style="float:right;clear:right;width:40%" | |||
{| class="wikitable" style="float:right;clear:right;width: | |||
!colspan="8"|Basic Info | !colspan="8"|Basic Info | ||
|+ | |+ | ||
Line 9: | Line 7: | ||
|'''Speed''' | |'''Speed''' | ||
|+ | |+ | ||
| | |[[Accumulator Addressing | Accumulator]] | ||
|BC | |BC | ||
|1 byte | |1 byte | ||
|2 cycles | |2 cycles | ||
|+ | |+ | ||
| | |[[Direct Page Addressing | Direct Page]] | ||
|AB | |AB | ||
|2 | |2 bytes | ||
|4 cycles | |4 cycles | ||
|+ | |+ | ||
| | |[[Direct Page Indexed by X]] | ||
|BB | |BB | ||
|2 | |2 bytes | ||
|5 cycles | |5 cycles | ||
|+ | |+ | ||
| | |[[Absolute Addressing | Absolute]] | ||
|AC | |AC | ||
|3 bytes | |3 bytes | ||
|5 cycles | |5 cycles | ||
|+ | |+ | ||
| | |[[Implied]] (type 1) | ||
|3D | |3D | ||
|1 byte | |1 byte | ||
|2 cycles | |2 cycles | ||
|+ | |+ | ||
| | |[[Implied]] (type 1) | ||
|FC | |FC | ||
|1 byte | |1 byte | ||
Line 41: | Line 39: | ||
{| class="wikitable" style="float:right;clear:right;width:30%" | {| class="wikitable" style="float:right;clear:right;width:30%" | ||
!colspan="8"|Flags | !colspan="8"|Flags Affected | ||
|+ | |||
|[[Negative Flag|N]] | |||
|[[Overflow Flag|V]] | |||
|[[Direct Page Flag|P]] | |||
|[[Break Flag|B]] | |||
|[[Half-Carry Flag|H]] | |||
|[[Interrupt Enable Flag|I]] | |||
|[[Zero Flag|Z]] | |||
|[[Carry Flag|C]] | |||
|+ | |+ | ||
|N | |N | ||
|. | |. | ||
|. | |. | ||
Line 58: | Line 56: | ||
|. | |. | ||
|. | |. | ||
|Z | |||
|. | |. | ||
|} | |} | ||
'''INC''' is an [[SPC700]] instruction that increments its operand by one. | |||
==== Syntax ==== | |||
<pre> | |||
INC A | |||
INC dp | |||
INC dp+X | |||
INC !abs | |||
INC X | |||
INC Y | |||
</pre> | |||
The above are official, but some people prefer alternate mnemonics like: | |||
<pre> | |||
INA | |||
INX | |||
INY | |||
</pre> | |||
=== See Also === | === See Also === | ||
* [[INC]] | * [[INC]] | ||
* [[DEC (SPC700)]] | |||
* [[INX]] | |||
* [[INY]] | |||
* [[ADC (SPC700)]] | |||
* [[ADC]] | |||
=== External Links === | |||
* Official Super Nintendo development manual on INC: [https://archive.org/details/SNESDevManual/book1/page/n232 Appendix C-7 of Book I] | |||
* anomie: https://github.com/yupferris/TasmShiz/blob/master/spc700.txt#L445 | |||
[[Category:ASM]] | [[Category:ASM]] | ||
[[Category:SPC700]] | [[Category:SPC700]] | ||
[[Category:Addition and Subtraction Commands]] | [[Category:Addition and Subtraction Commands]] |
Latest revision as of 14:00, 30 July 2024
Basic Info | |||||||
---|---|---|---|---|---|---|---|
Addressing Mode | Opcode | Length | Speed | ||||
Accumulator | BC | 1 byte | 2 cycles | ||||
Direct Page | AB | 2 bytes | 4 cycles | ||||
Direct Page Indexed by X | BB | 2 bytes | 5 cycles | ||||
Absolute | AC | 3 bytes | 5 cycles | ||||
Implied (type 1) | 3D | 1 byte | 2 cycles | ||||
Implied (type 1) | FC | 1 byte | 2 cycles |
Flags Affected | |||||||
---|---|---|---|---|---|---|---|
N | V | P | B | H | I | Z | C |
N | . | . | . | . | . | Z | . |
INC is an SPC700 instruction that increments its operand by one.
Syntax
INC A INC dp INC dp+X INC !abs INC X INC Y
The above are official, but some people prefer alternate mnemonics like:
INA INX INY
See Also
External Links
- Official Super Nintendo development manual on INC: Appendix C-7 of Book I
- anomie: https://github.com/yupferris/TasmShiz/blob/master/spc700.txt#L445