We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5e6b8d commit 454b406Copy full SHA for 454b406
src/libc/allocator_simple.src
@@ -5,24 +5,17 @@
5
public __simple_malloc
6
__simple_malloc:
7
pop bc
8
- ex (sp),de
+ ex (sp),hl
9
push bc
10
- ld bc,(_heap_ptr)
11
- push bc
12
- pop iy
13
- add iy,de
14
- lea hl,iy
15
- or a,a
16
- sbc hl,bc
+ ld de,(_heap_ptr)
+ add hl,de
17
jr c,.null
18
- ld de,___heaptop
19
20
21
- sbc hl,de
+ ld bc,___heaptop
+ sbc hl,bc
22
jr nc,.null
23
- ld (_heap_ptr),iy
24
25
- pop hl
+ add hl,bc
+ ld (_heap_ptr),hl
+ ex de,hl
26
ret
27
.null:
28
or a,a
0 commit comments