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

Immediate Addressing: Difference between revisions

From SnesLab
Jump to: navigation, search
(ADD (Super FX))
(→‎References: fixed link number)
 
(43 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Immediate Addressing''' is when the data to be operated on directly follows the opcode in the instruction steam.  The immediate data is generally preceded by a # in the assembler source.
'''Immediate Addressing''' is when the data to be operated on directly follows the opcode in the instruction steam.  The immediate data is generally preceded by a # in the assembler source.<sup>[7]</sup>


Supported by the following instructions:
Supported by the following [[65c816]] instructions:


* [[ADC]]
* [[ADC]] (opcode 69)
* [[SBC]]
* [[SBC]] (opcode E9)
* [[EOR]]
* [[EOR]] (opcode 49)
* [[AND]]
* [[AND]] (opcode 29)
* [[ORA]]
* [[ORA]] (opcode 09)
* [[LDA]]
* [[LDA]] (opcode A9)
* [[LDX]]
* [[LDX]] (opcode A2)
* [[LDY]]
* [[LDY]] (opcode A0)
* [[CMP]]
* [[CMP]] (opcode C9)
* [[CPX]]
* [[CPX]] (opcode E0)
* [[CPY]]
* [[CPY]] (opcode C0)
* [[BIT]]
* [[BIT]] (opcode 89)
* [[SEP]]
* [[SEP]] (opcode E2)
* [[REP]]
* [[REP]] (opcode C2)
* [[ADD (Super FX)]]
 
They are all either 2 or 3 bytes long.
 
The [[Super FX]] supports immediate addressing too:</sup>
* [[ADC (Super FX)|ADC]]
* [[ADD (Super FX)|ADD]]
* [[AND (Super FX)|AND]]
* [[BIC]]
* [[SUB]]
* [[OR]]
* [[MULT]]
* [[IWT]]
* [[IBT]]
* [[LINK]]
* and presumably [[UMULT]] too
 
On the [[SPC700]], "imm" means "8-bit immediate data."<sup>[4]</sup>  These commands support immediate data:
* [[MOV (SPC700)|MOV]] (Group 1)
* [[ADC (SPC700)|ADC]]
* [[SBC (SPC700)|SBC]]
* [[CMP (SPC700)|CMP]]
* [[AND (SPC700)|AND]]
* [[OR (SPC700)|OR]]
* [[EOR (SPC700)|EOR]]
 
==== Syntax ====
<pre>
LDA #const
</pre>


=== See Also ===
=== See Also ===
* [[Implied Addressing]]
* [[Implied Addressing]]
* [[Accumulator Addressing]]
* [[PEA]]


=== Reference ===
=== References ===
* [[Eyes & Lichty]] page 397, https://archive.org/details/0893037893ProgrammingThe65816/page/n423
# [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/397 page 397]
# lbid, [https://archive.org/details/0893037893ProgrammingThe65816/page/108 page 108]
# [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n219 page 209]
# [https://archive.org/details/SNESDevManual/book1/page/n226 Appendix C-1 of Book I] of the official Super Nintendo development manual
# section 3.5.18 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf
# Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#5.14
# [https://archive.org/details/mos_microcomputers_programming_manual/page/n203 B-2]


[[Category:ASM]]
[[Category:ASM]]
[[Category:Addressing Modes]]
[[Category:Addressing Modes]]
[[Category:Simple Admodes]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]

Latest revision as of 03:20, 9 August 2024

Immediate Addressing is when the data to be operated on directly follows the opcode in the instruction steam. The immediate data is generally preceded by a # in the assembler source.[7]

Supported by the following 65c816 instructions:

  • ADC (opcode 69)
  • SBC (opcode E9)
  • EOR (opcode 49)
  • AND (opcode 29)
  • ORA (opcode 09)
  • LDA (opcode A9)
  • LDX (opcode A2)
  • LDY (opcode A0)
  • CMP (opcode C9)
  • CPX (opcode E0)
  • CPY (opcode C0)
  • BIT (opcode 89)
  • SEP (opcode E2)
  • REP (opcode C2)

They are all either 2 or 3 bytes long.

The Super FX supports immediate addressing too:

On the SPC700, "imm" means "8-bit immediate data."[4] These commands support immediate data:

Syntax

LDA #const

See Also

References

  1. Eyes & Lichty, page 397
  2. lbid, page 108
  3. Labiak, page 209
  4. Appendix C-1 of Book I of the official Super Nintendo development manual
  5. section 3.5.18 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf
  6. Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#5.14
  7. B-2