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
From SnesLab
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
- Eyes & Lichty, page 459 on JMP
- Labiak, page 145 on JML
- lbid, page 146 on JMP
- 4.0.2 on MCS6500 Manual, page 36 on JMP
- Carr, page 261 on JMP
- Leventhal, page 3-69 on JMP
- Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#JMP