c64-livecoding/wip-hugo/routines/memory/memset.s
2025-05-15 17:14:24 +02:00

25 lines
516 B
ArmAsm
Executable file

;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
;; Sets memory in A to all addresses from B_start to B_end
;; Modifies A, X and B_start
.proc memset
.include "mem.inc"
LDY #$00
loop:
STA (A_start), Y
INY
BEQ y_overflow
change_length:
DEC length
BNE loop
DEC length +1
BPL loop
JMP loop_end
y_overflow:
LDY #$00
INC A_start + 1
jmp change_length
loop_end:
RTS
.endproc