deleted old files and modified some dsa source files
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
dw global_arena_start: 0x30000
|
||||
dw global_arena_current: 0x30000
|
||||
dw global_arena_end: 0x40000
|
||||
|
||||
arena_alloc:
|
||||
// Just like bump allocator
|
||||
push bpr
|
||||
mov spr, bpr
|
||||
|
||||
ldw bpr, rg0, 8 // size argument
|
||||
ldw global_arena_current, rg1
|
||||
|
||||
add rg1, rg0, rg2 // new_current = current + size
|
||||
ldw global_arena_end, rg3
|
||||
|
||||
cmp rg2, rg3
|
||||
jgt out_of_memory
|
||||
|
||||
stw rg2, global_arena_current
|
||||
mov rg1, acc // return old current
|
||||
stw acc, bpr, 8
|
||||
|
||||
mov bpr, spr
|
||||
pop bpr
|
||||
return
|
||||
|
||||
arena_reset:
|
||||
// Reset to start
|
||||
push bpr
|
||||
mov spr, bpr
|
||||
|
||||
ldw global_arena_start, rg0
|
||||
stw rg0, global_arena_current
|
||||
|
||||
mov bpr, spr
|
||||
pop bpr
|
||||
return
|
||||
Reference in New Issue
Block a user