mirror of
https://github.com/thornAvery/jep-hack.git
synced 2025-09-17 02:30:50 +12:00
37 lines
502 B
NASM
37 lines
502 B
NASM
CopyName1::
|
|
; Copies the name from de to wStringBuffer2
|
|
ld hl, wStringBuffer2
|
|
|
|
CopyName2::
|
|
; Copies the name from de to hl
|
|
.loop
|
|
ld a, [de]
|
|
inc de
|
|
ld [hli], a
|
|
cp "@"
|
|
jr nz, .loop
|
|
ret
|
|
|
|
CopyStringWithTerminator::
|
|
; in: hl = source, de = destination, c = length (non-zero)
|
|
; out: clobbers all but b
|
|
dec c
|
|
.copy_loop
|
|
ld a, [hli]
|
|
ld [de], a
|
|
inc de
|
|
cp "@"
|
|
jr z, .clear_loop
|
|
dec c
|
|
jr nz, .copy_loop
|
|
ld a, "@"
|
|
ld [de], a
|
|
ret
|
|
|
|
.clear_loop
|
|
ld [de], a
|
|
inc de
|
|
dec c
|
|
jr nz, .clear_loop
|
|
ret
|