gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/asm/sm83/_memset.s
1 .module memset
2
3 .area _HOME
4
5 ; void *memset (void *s, int c, size_t n)
6 _memset::
7 ld a, c
8
9 pop hl ; pop return address
10 pop bc ; pop n
11 push hl ; push return address
12
13 ld h, d
14 ld l, e
15
16 srl b
17 rr c
18 jr nc,0$
19 ld (hl+),a
20 0$:
21 srl b
22 inc b
23 rr c
24
25 jr c,2$
26 jr z,3$
27 1$:
28 dec c
29 ld (hl+),a
30 ld (hl+),a
31 2$:
32 ld (hl+),a
33 ld (hl+),a
34 jr nz,1$
35 3$:
36 dec b
37 jr nz,1$
38
39 ; return s in bc
40 ld b, d
41 ld c, e
42
43 ret
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.