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 c,(hl)
- inc hl
- ld b,(hl)
- _ inc hl
- djnz -_
- inc hl
- inc hl
- ld a,h
- cp UserRAMEnd >> 8
- jr c,FTMLoop ; if hl < UserRAMEnd; goto FTMLoop
- ld a,l
- cp UserRAMEnd & $FF
- jr c,FTMLoop ; if hl < UserRAMEnd; goto FTMLoop
- pop hl
- pop de
- pop bc
- pop af
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement