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 de
- push hl
- push ix
- ld hl,UserRAM
- FTMLoop cp (hl)
- jr nz,FTMSkip
- push hl
- pop ix
- call FreeMem
- FTMSkip inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- add hl,de ; jump to next section
- ld de,UserRAMEnd ; get the end of UserRAM
- sbc hl,de ; compare
- add hl,de
- jr nc,FTMLoop ; loop again if hl < UserRAMEnd
- pop ix
- pop hl
- pop de
- pop af
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement