;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- ;;Moves data from buffer A to B. ;; Buffer A starts at 'A_start' and B starts att 'B_start'. ;; The data has length 'length'. .proc memcpy .include "mem.inc" LDY #$00 loop: LDA (B_start), Y STA (A_start), Y INY BEQ y_overflow change_length: DEC length BNE loop DEC length +1 BPL loop RTS y_overflow: ;; Y is now 0 INC B_start + 1 INC A_start + 1 jmp change_length .endproc