mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-11-26 15:49:18 +00:00
a8d89e373a
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@71 4df02467-bbd4-4a76-a152-e7ce94205b78
35 lines
993 B
Plaintext
35 lines
993 B
Plaintext
;ACME 0.95.7
|
|
|
|
!ifdef lib_cbm_c64_memcopy_a !eof
|
|
lib_cbm_c64_memcopy_a = 1
|
|
|
|
; this macro inserts code to copy a memory block.
|
|
; it calls a function from the basic interpreter, so:
|
|
; - BASIC ROM must be banked in
|
|
; - the source block must be readable (so no RAM hidden under BASIC, Kernal, or I/O)
|
|
; - the target block must be writable (so no RAM hidden under I/O)
|
|
; higher addresses are copied first, so:
|
|
; - moving data to higher addresses works even if areas overlap
|
|
; - moving data to lower addresses only works if areas do not overlap
|
|
!macro basic_memcopy .src_start, .src_end, .target_start {
|
|
!address {
|
|
.z_target_end = $58
|
|
.z_src_end = $5a
|
|
.z_src_start = $5f
|
|
.fn = $a3bf
|
|
}
|
|
lda #<.src_start
|
|
ldx #>.src_start
|
|
sta .z_src_start
|
|
stx .z_src_start + 1
|
|
lda #<.src_end
|
|
ldx #>.src_end
|
|
sta .z_src_end
|
|
stx .z_src_end + 1
|
|
lda #<(.target_start + .src_end - .src_start)
|
|
ldx #>(.target_start + .src_end - .src_start)
|
|
sta .z_target_end
|
|
stx .z_target_end + 1
|
|
jsr .fn
|
|
}
|