Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Clears all memory accociated with a thread
- ; inputs a = Thread ID
- FreeThreadMem:
- push af
- push bc
- push de
- push hl
- ld hl,UserRAM
- ld d,a
- FTMLoop ld a,(hl)
- push hl
- pop ix
- cp d
- call z,FreeMem
- inc hl
- ld b,(hl)
- inc hl
- ld c,(hl)
- add hl,bc ; jump to next section
- inc hl
- inc hl ; skip the footer
- ex de,hl ; put the location in de
- ld hl,-UserRAMEnd ; get the end of UserRAM
- add hl,de ; compare
- ex de,hl ; put it back in hl
- jr z,FTMLoop ; loop again if
- jr c,FTMLoop ; hl < UserRAMEnd
- pop hl
- pop de
- pop bc
- pop af
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement