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

JMP: Difference between revisions

From SnesLab
Jump to: navigation, search
(linkify absolute)
(→‎External Links: hid archive URL for Leventhal)
 
(30 intermediate revisions by the same user not shown)
Line 12: Line 12:
|3 cycles
|3 cycles
|+
|+
|absolute indirect
|[[Absolute Indirect]]
|6C
|6C
|3 bytes
|3 bytes
|5 cycles
|5 cycles
|+
|+
|absolute indexed indirect
|[[Absolute Indexed Indirect]]
|7C
|7C
|3 bytes
|3 bytes
|6 cycles
|6 cycles
|+
|+
|absolute long
|[[Absolute Long]]
|5C
|5C
|4 bytes
|4 bytes
|4 cycles
|4 cycles
|+
|+
|absolute indirect long
|[[Absolute Indirect Long]]
|DC
|DC
|3 bytes
|3 bytes
Line 36: Line 36:
!colspan="9"|Flags Affected
!colspan="9"|Flags Affected
|+
|+
|N
|[[Negative Flag|N]]
|V
|[[Overflow Flag|V]]
|M
|[[M Flag|M]]
|X
|[[X Flag|X]]
|D
|[[Decimal Flag|D]]
|I
|[[I Flag|I]]
|Z
|[[Zero Flag|Z]]
|C
|[[Carry Flag|C]]
|+
|+
|.
|.
Line 55: Line 55:
|}
|}


'''JMP''' is a [[65c816]] instruction that performs an unconditional jump.
'''JMP''' is a [[65c816]] instruction that performs an unconditional jump. This is analogous to GOTO in middle level programming languages.
 
JMP to a long address and JML work even in [[emulation mode]], but are primarily intended for native mode.
 
==== Quirk ====
The NMOS 6502's opcode 6C sometimes behaves incorrectly.  When doing an indirect jump, care must be taken to make sure the two-byte vector containing the absolute target address does not straddle a [[page]] boundary (that is, the vector is not located at $xxFF for any xx).  Otherwise, byte zero ($xx00) of the page the vector begins in will be misused as the high byte of the target address instead of the first byte of the following page.
 
JMP is not relocatable.  No flags are affected.
 
==== Syntax ====
<pre>
JMP addr
JMP (addr)
JMP (addr, X)
JMP long
JML long
JMP [addr]
JML [addr]
</pre>


=== See Also ===
=== See Also ===
* [[BRA]]
* [[BRA]]
* [[BRL]]
* [[LJMP (Super FX)]]


=== External Links ===
=== External Links ===
* [[Eyes & Lichty]] page on JMP: https://archive.org/details/0893037893ProgrammingThe65816/page/n485
* [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/459 page 459] on JMP
* [[Labiak]] page on JMP: https://archive.org/details/Programming_the_65816/page/n155
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n155 page 145] on JML
* [[MCS6500 Manual]] page on JMP: https://archive.org/details/mos_microcomputers_programming_manual/page/n51
* lbid, [https://archive.org/details/Programming_the_65816/page/n156 page 146] on JMP
* [[Carr]] page on JMP: https://archive.org/details/6502UsersManual/page/n274
* 4.0.2 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n51 page 36] on JMP
* [[Leventhal]] page on JMP: https://archive.org/details/6502-assembly-language-programming/page/n118
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n274 page 261] on JMP
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n118 page 3-69] on JMP
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#JMP


[[Category:ASM]]
[[Category:ASM]]
[[Category:Group Three Instructions]]
[[Category:Group Three Instructions]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]
[[Category:Unconditional Branches]]
[[Category:Non-relocatable Instructions]]

Latest revision as of 03:35, 8 August 2024

Basic Info
Addressing Mode Opcode Length Speed
Absolute 4C 3 bytes 3 cycles
Absolute Indirect 6C 3 bytes 5 cycles
Absolute Indexed Indirect 7C 3 bytes 6 cycles
Absolute Long 5C 4 bytes 4 cycles
Absolute Indirect Long DC 3 bytes 6 cycles
Flags Affected
N V M X D I Z C
. . . . . . . .

JMP is a 65c816 instruction that performs an unconditional jump. This is analogous to GOTO in middle level programming languages.

JMP to a long address and JML work even in emulation mode, but are primarily intended for native mode.

Quirk

The NMOS 6502's opcode 6C sometimes behaves incorrectly. When doing an indirect jump, care must be taken to make sure the two-byte vector containing the absolute target address does not straddle a page boundary (that is, the vector is not located at $xxFF for any xx). Otherwise, byte zero ($xx00) of the page the vector begins in will be misused as the high byte of the target address instead of the first byte of the following page.

JMP is not relocatable. No flags are affected.

Syntax

JMP addr
JMP (addr)
JMP (addr, X)
JMP long
JML long
JMP [addr]
JML [addr]

See Also

External Links