cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

_strcpy.s (463B)


      1        .module strcpy
      2
      3        .area   _HOME
      4
      5; char *strcpy(char *dest, const char *source)
      6_strcpy::
      7        lda     hl,2(sp)
      8        ld      a,(hl+)
      9        ld      e, a
     10        ld      a,(hl+)
     11        ld      d, a
     12        ld      a,(hl+)
     13        ld      h,(hl)
     14        ld      l,a
     15
     16        push    de
     171$:     
     18        ld      a,(hl+)
     19        ld      (de),a
     20        inc     de
     21        or      a,a
     22        jr      nz,1$
     23
     24        pop     de
     25        ret
     26