Advertisement
ISSOtm

Some SDCC code

Oct 1st, 2018
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; I've got only one thing to say
  2. ; DIE.
  3.  
  4. _memcpy::
  5.     add    sp, #-8
  6. ;pmd-red/newlib/libc/string/memcpy.c:59: char *dst = (char *) dst0;
  7.     ldhl    sp,#10
  8.     ld    a,(hl+)
  9.     ld    e, (hl)
  10.     ldhl    sp,#6
  11.     ld    (hl+),a
  12.     ld    (hl),e
  13. ;pmd-red/newlib/libc/string/memcpy.c:60: char *src = (char *) src0;
  14.     ldhl    sp,#12
  15.     ld    a,(hl+)
  16.     ld    e, (hl)
  17.     ldhl    sp,#4
  18.     ld    (hl+),a
  19.     ld    (hl),e
  20. ;pmd-red/newlib/libc/string/memcpy.c:62: _PTR save = dst0;
  21.     ldhl    sp,#10
  22.     ld    a,(hl+)
  23.     ld    e, (hl)
  24.     ldhl    sp,#0
  25.     ld    (hl+),a
  26.     ld    (hl),e
  27. ;pmd-red/newlib/libc/string/memcpy.c:64: while (len0--)
  28.     ldhl    sp,#(15 - 1)
  29.     ld    c,(hl)
  30.     inc    hl
  31.     ld    b,(hl)
  32. 00101$:
  33.     ldhl    sp,#2
  34.     ld    (hl),c
  35.     inc    hl
  36.     ld    (hl),b
  37.     dec    bc
  38.     ld    a,(hl-)
  39.     or    a,(hl)
  40.     jr    Z,00103$
  41. ;pmd-red/newlib/libc/string/memcpy.c:66: *dst++ = *src++;
  42.     ldhl    sp,#(5 - 1)
  43.     ld    e,(hl)
  44.     inc    hl
  45.     ld    d,(hl)
  46.     ld    a,(de)
  47.     dec    hl
  48.     inc    (hl)
  49.     jr    NZ,00115$
  50.     inc    hl
  51.     inc    (hl)
  52. 00115$:
  53.     ldhl    sp,#(7 - 1)
  54.     ld    e,(hl)
  55.     inc    hl
  56.     ld    d,(hl)
  57.     ld    (de),a
  58.     dec    hl
  59.     inc    (hl)
  60.     jr    NZ,00101$
  61.     inc    hl
  62.     inc    (hl)
  63.     jr    00101$
  64. 00103$:
  65. ;pmd-red/newlib/libc/string/memcpy.c:69: return save;
  66.     pop    de
  67.     push    de
  68.     add    sp, #8
  69.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement