View Single Post
Old 15 December 2004, 16:07   #15
AmiGer
Registered User
AmiGer's Avatar
 
Join Date: Sep 2002
Location: Germany
Posts: 349
...runs perfectly now. I have built this small wrapper to alloc and free memory, works fine.

Good work, Photon !

Code:
_LVOAllocMem		equ	-198
_LVOFreeMem		equ	-210

MEMF_PUBLIC		equ	0
MEMF_CHIP		equ	1<<1
MEMF_FAST		equ	1<<2
MEMF_CLEAR		equ	1<<16 

oDataLen=0
oCrunchLen=4
oJumpAddr=8
oTokens=12
oData=28

	SECTION	Startup, CODE, CHIP
	
	movem.l	d2-d7/a2-a6,-(sp)
	lea 	StartOfData(pc),a5	
	move.l	(a5),d0
	add.l	#256,d0
	lea	DataLen(pc),a0
	move.l	d0,(a0)
	move.l	#MEMF_CLEAR!MEMF_CHIP,d1
	move.l	4.w,a6
	jsr	_LVOAllocMem(a6)
	tst.l	d0
	beq	MNoMem
	lea	_Data(pc),a0
	move.l	d0,(a0)
	move.l	d0,oJumpAddr(a5)
	
	bsr	DeCrunchIt

	move.l	_Data(pc),a1
	move.l	DataLen(pc),d0
	move.l	4.w,a6
	jsr	_LVOFreeMem(a6)
	
MNoMem	movem.l	(sp)+,d2-d7/a2-a6
	moveq.l	#0,d0
	rts

_Data	dc.l	0
DataLen	dc.l	0
AmiGer is offline  
 
Page generated in 0.07501 seconds with 11 queries