l_setmem.asm
bitfixer_bitfixer/dg/z88dk/libsrc/z80_crt0s/crt0/l_setmem.asm
; 01.2007 aralbrec

PUBLIC l_setmem

; Many places in the library have functions
; that initialize structures to 0.  This
; consolidates all those initializations into
; one quick routine.

; enter: a = init char, hl = top of struct
; usage: call l_setmem - 2*bytes + 1
;        where bytes = # bytes to write, up to 16

   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl

   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl

   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl

   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a
   inc hl
   ld (hl),a

.l_setmem
   
   ret
