All pastes #287155 Raw Edit

Someone

public text v1 · immutable
#287155 ·published 2006-12-21 05:40 UTC
rendered paste body
mmap:
	ld	ixh,(memendh)	;get the last available memory address
	ld	ixl,(memendl)
	dec ix
	dec ix
	ld	(memendh),ixh	;save new memory last available address
	ld	(memendl),ixl
	ld	(ix+1),iyh		;save mmap record
	ld	(ix+2),iyl
	ld	hl,bc
	ld	(iy),h			;save the size in the header
	inc iy
	ld	(iy),l
	ld	ix,Kernel_CurTask	;gets the task memory address
	ld	a,(ix+6)			;gets the task id	
	inc iy
	ld	(iy),a				;put the app id on the header
	inc iy
	inc iy
	ld hl,iy;				;put the memory starting address on hl to be returned by API 
	ret