We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
MVP: Difference between revisions
From SnesLab
(capitalize admode) |
(→External Links: hid archive URL for E&L) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 40: | Line 40: | ||
In [[Eyes & Lichty]], the "P" in the mnemonic stands for "Previous" not "Positive." | In [[Eyes & Lichty]], the "P" in the mnemonic stands for "Previous" not "Positive." | ||
MVP works even in [[emulation mode]], but the blocks must be in the [[zeropage]]. | |||
=== Parameters === | === Parameters === | ||
Line 53: | Line 55: | ||
* both X and Y are decremented | * both X and Y are decremented | ||
* C is decremented | * C is decremented | ||
If interrupted, the current byte finishes copying before servicing the interrupt. The destination bank is written to [[DBR]]. | |||
=== See Also === | === See Also === | ||
Line 59: | Line 62: | ||
=== External Links === | === External Links === | ||
* [[Eyes & Lichty]] | * [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/468 page 468] on MVP | ||
* [[Labiak]] | * [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n164 page 154] on MVP | ||
* snes9x implementation of MVP: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L3077 | * snes9x implementation of MVP: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L3077 | ||
* undisbeliever on MVP: https://undisbeliever.net/snesdev/65816-opcodes.html#mvp-block-move-previous | * undisbeliever on MVP: https://undisbeliever.net/snesdev/65816-opcodes.html#mvp-block-move-previous | ||
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.6 | |||
[[Category:ASM]] | [[Category:ASM]] |
Latest revision as of 20:25, 6 August 2024
Basic Info | |||||||
---|---|---|---|---|---|---|---|
Addressing Mode | Opcode | Length | Speed | ||||
Block Move | 44 | 3 bytes | 7 cycles per byte moved |
Flags Affected | ||||||||
---|---|---|---|---|---|---|---|---|
N | V | M | X | D | I | Z | C | |
. | . | . | . | . | . | . | . |
MVP (Block Move Positive) is a 65c816 instruction that copies a contiguous block of memory. It is intended to copy a block from a lower address to a higher address (moving it in the positive direction). No flags are affected.
In Eyes & Lichty, the "P" in the mnemonic stands for "Previous" not "Positive."
MVP works even in emulation mode, but the blocks must be in the zeropage.
Parameters
- the X index register specifies the ending (highest) source address of the block
- the Y index register specifies the ending (highest) destination address of the block
- the C double accumulator specifies the length of the block in bytes minus one
- the first operand byte specifies the destination bank the block will be in
- the second operand byte specifies the source bank the block starts out in
Execution Sequence
The following loop is repeated until the value in the C double accumulator is $FFFF:
- one byte is copied from the address in X to the address in Y
- both X and Y are decremented
- C is decremented
If interrupted, the current byte finishes copying before servicing the interrupt. The destination bank is written to DBR.
See Also
External Links
- Eyes & Lichty, page 468 on MVP
- Labiak, page 154 on MVP
- snes9x implementation of MVP: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L3077
- undisbeliever on MVP: https://undisbeliever.net/snesdev/65816-opcodes.html#mvp-block-move-previous
- Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.6