As tia, tii, tin, etc... only takes immediate values as arguments, the trick is to have the copy instruction in ram and modify the arguments.
Memory copy. | As tia, tii, tin, etc... |
Copy Modes. | |
SOURCE_ALT_DEST_INC | Alternate source address and increment destination address (TAI). |
SOURCE_DEC_DEST_DEC = $c3 | Decrement source and destination addresses (TDD). |
SOURCE_INC_DEST_ALT | Increment source address and alternate destination address (TIA). |
SOURCE_INC_DEST_NOP | Increment source address and leave destination address unchanged (TIN). |
SOURCE_INC_DEST_INC | Increment source and destination addresses (TII). |
Memory copy helpers. | |
memcpy_init | Initialize memcpy routine. |
memcpy_mode | Set memcpy mode (see Copy Modes). |
memcpy_args | Set memcpy arguments. |
memcpy_ex | Copy len bytes from the src to dst. |
Copy len bytes from the src to dst. This is equivalent to :
memcpy_mode mode memcpy_args src, dst, len jsr memcpy
memcpy_ex <_si, #video_data, #$0100, #SOURCE_INC_DEST_ALT
src | source. |
dst | destination. |
len | number of bytes to copy. |
mode | memory copy mode (see Copy Modes). optinal (default: SOURCE_INC_DEST_ALT). |
Alternate source address and increment destination address (TAI).
SOURCE_ALT_DEST_INC = $f3
Decrement source and destination addresses (TDD).
SOURCE_DEC_DEST_DEC = $c3
Increment source address and alternate destination address (TIA).
SOURCE_INC_DEST_ALT = $e3
Increment source address and leave destination address unchanged (TIN).
SOURCE_INC_DEST_NOP = $d3
Increment source and destination addresses (TII).
SOURCE_INC_DEST_INC = $73