My Game Boy entry for the 2019 GMTK Game Jam
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
774 B

;*
;* MEMORY.ASM - Memory Manipulation Code
;* by GABY. Inspired by Carsten Sorensen & others.
;*
;* V1.0 - Original release
;*
;If all of these are already defined, don't do it again.
IF !DEF(MEMORY_ASM)
MEMORY_ASM SET 1
SECTION "Memory Code",ROM0
mem_Set::
inc b
inc c
jr .skip
.loop ld [hl+],a
.skip dec c
jr nz,.loop
dec b
jr nz,.loop
ret
;***************************************************************************
;*
;* mem_Copy - "Copy" a memory region
;*
;* input:
;* hl - pSource
;* de - pDest
;* bc - bytecount
;*
;***************************************************************************
mem_Copy::
inc b
inc c
jr .skip
.loop ld a,[hl+]
ld [de],a
inc de
.skip dec c
jr nz,.loop
dec b
jr nz,.loop
ret
ENDC ;MEMORY1_ASM