

	incdir	Includes:
	include	exec/execbase.i
	include	exec/libraries.i
	include	exec/memory.i
	include	offsets/dos_lib.i
	include	offsets/exec_lib.i


KICKVERSION	equ	36
NEWERKICK	equ	39

Begin:
	bra	Start

	dc.b	'$VER: AllocAbs 1.2 (21.11.96)',10
	dc.b	'© 1996 by Tadek Knapik. Public Domain.',0,0

Start:
	move.l	$4,a6
	move.l	a6,_SysBase

	move.w	LIB_VERSION(a6),KickVer		;We'll need it later
	cmp.w	#KICKVERSION,KickVer		;but we need it now, too
	blt	Error

	bsr	OpenDOS				;dos.library
	move.l	d0,_DOSBase
	beq	Error

	move.l	#0,Address			;clear
	move.l	#0,Size				;values
	move.l	#0,Proof			;and
	move.l	#0,UnSafe			;switches
	move.l	#0,Free				;

	move.l	d0,a6				;DOSBase
	move.l	#Template,d1			;my template
	move.l	#ArgsArray,d2			;my array
	moveq	#0,d3				;my nothing
	jsr	_LVOReadArgs(a6)		;parse
	move.l	d0,_ReadArgs			;went OK?
	bne	ArgsOK				;yep!

Error2:
	bsr	CloseDOS			;error
	bra	Error

ArgsOK:
	move.l	Address,a0		;in a0 - pointer to a string
	bsr	AnyStrToLong		;parse the address
	tst.l	d1			;OK?
	bne	AddressOK
Error3:
	bsr	FreeArgs
	bra	Error2

AddressOK:
	move.l	d0,d5			;pointer in d5
	move.l	Size,a0
	bsr	AnyStrToLong		;parse the size
	tst.l	d1
	bne	SizeOK

	bra	Error3

SizeOK:
	move.l	_SysBase,a6
	move.l	d0,d4			;size in d4
	tst.l	Free
	bne	FreeThatMem		;free memory


;let's see if this can be made resident (if requested)

	tst.l	Proof
	beq	NoProofTest

	move.l	d5,a1				;mem address
	jsr	_LVOTypeOfMem(a6)		;
	andi.l	#MEMF_LOCAL!MEMF_KICK,d0	;should be..
	bne	NoProofTest

	move.l	#NoRIPTypeTxt,d1
	bsr	ShowDOSInfo
	bra	Failed


NoProofTest:
	tst.l	Force			;exact values?
	bne	ForceNow		;jump if so

	subi.l	#8,d5			;8 bytes earlier than requested
	addi.l	#8,d4			;so 8 bytes more

ForceNow:
	move.l	d4,d0			;size
	move.l	d5,a1			;address

	jsr	_LVOAllocAbs(a6)	;that's it
	tst.l	d0
	bne	AllocatedOK

	tst.l	Force			;these were exact arguments?
	bne	AllocFailed		;yes

	tst.l	UnSafe			;try with (un)mofified?
	beq	AllocFailed		;nope

	move.l	#1,Force		;don't loop!
	addi.l	#8,d5			;later
	subi.l	#8,d4			;less
	bra	ForceNow		;try again

AllocFailed:

	move.l	#AllocFailedTxt,d1	;sorry, no bonus
	bsr	ShowDOSInfo		;tell'em

Failed:
	bsr	FreeArgs
	bsr	CloseDOS
	moveq	#5,d0
	rts

AllocatedOK:
	move.l	#AllocOKTxt,d1		;say what and where
	bsr	ShowDOSInfo

	tst.l	Proof			;reset proof?
	beq	Koniec			;no

;ML_SIZE contains the NODE structure

	move.l	#ML_SIZE+ME_SIZE+ME_SIZE+[IDStringEnd-IDString],d0	;block size
	move.l	d0,d3					;remember
	move.l	#MEMF_CLEAR!MEMF_PUBLIC!MEMF_LOCAL,d1	;flags
	cmpi.w	#NEWERKICK,KickVer			;V39 up?
	blt	AllocRIPNow
	ori.l	#MEMF_KICK,d1				;mem type since V39

AllocRIPNow:
	jsr	_LVOAllocMem(a6)		;alloc mem for structure
	tst.l	d0
	bne	RIPAllocatedOK			;OK?

	move.l	#AllocRIPFailedTxt,d1		;couldn't do this
	bsr	ShowDOSInfo

	move.l	d5,a1			;undo
	move.l	d4,d0			;this move

	jsr	_LVOFreeMem(a6)		;give back to the system

	move.l	#FreedOKTxt,d1		;info
	bsr	ShowDOSInfo

	bra	Failed			;not good..

RIPAllocatedOK:

;first goes the node, then number of entries (2 - first is the user memory,
;second is memory for this block), and entries itself, then IDstring

	move.l	d0,a5
	move.b	#NT_MEMORY,LN_TYPE(a5)		;node type
	move.w	#2,ML_NUMENTRIES(a5)		;number of entries
	move.l	d5,ML_SIZE+ME_ADDR(a5)		;address
	move.l	d4,ML_SIZE+ME_LENGTH(a5)	;size
	move.l	a5,ML_SIZE+ME_SIZE+ME_ADDR(a5)	;this address
	move.l	d3,ML_SIZE+ME_SIZE+ME_LENGTH(a5) ;this size

	lea	ML_SIZE+ME_SIZE+ME_SIZE(a5),a1	;for the string
	move.l	a1,LN_NAME(a5)			;fill in
	lea	IDString,a0
	bsr	CopyString

	jsr	_LVOForbid(a6)

	move.l	KickMemPtr(a6),d0		;any list?
	beq	FillIn

	move.l	d0,LN_SUCC(a5)			;it's my successor..
	move.l	d0,a0
	move.l	a5,LN_PRED(a0)			;and I'm a predecessor..

FillIn:
	move.l	a5,KickMemPtr(a6)		;

	jsr	_LVOSumKickData(a6)		;do checksumming
	move.l	d0,KickCheckSum(a6)		;fill in

	jsr	_LVOCacheClearU(a6)		;clear caches..

	jsr	_LVOPermit(a6)

	move.l	#AddedKickMemTxt,d1		;info
	bsr	ShowDOSInfo

Koniec:
	bsr	FreeArgs
	bsr	CloseDOS
	moveq	#0,d0
	rts

;freeing the memory block..

FreeThatMem:
	move.l	_SysBase,a6
	tst.l	Proof			;was it there
	bne	FreeProofMem		;yep!

FreeNow:
	move.l	d5,a1			;address
	move.l	d4,d0			;size

	jsr	_LVOFreeMem(a6)		;simple but dangerous!

	move.l	#FreedOKTxt,d1		;Am I right?
	bsr	ShowDOSInfo

	bra	Koniec

;now, a little bit dirty (I mean not very consistent) procedure to
;remove the node from KickMemPtr list

FreeProofMem:
	jsr	_LVOForbid(a6)

	move.l	KickMemPtr(a6),d0
	beq	FreeProofMemFailed		;no proof mem

	sub.l	a1,a1				;clear

SearchProofMem:
	move.l	d0,a0

	cmp.l	ML_SIZE+ME_ADDR(a0),d5
	beq	GotThatProofMem

	move.l	LN_SUCC(a0),d0		;successor
	beq	FreeProofMemFailed

	move.l	a0,a1			;predecessor (single-linked!)
	bra	SearchProofMem


GotThatProofMem:
	cmp.l	ML_SIZE+ME_LENGTH(a0),d4
	bne	FreeProofMemFailed			;sth is wrong!

;this is it!

	move.l	ML_SIZE+ME_SIZE+ME_ADDR(a0),d3		;block address
	move.l	ML_SIZE+ME_SIZE+ME_LENGTH(a0),d2	;block size

	move.l	LN_SUCC(a0),d0
	beq	NoSucc

	move.l	a1,d1			;any predecessor?
	beq	NoPred

	move.l	d0,a0			;the successor
	move.l	d0,LN_SUCC(a1)		;now it's time to
	move.l	d1,LN_PRED(a0)		;make a switch :)
	bra	FreeProofMemOver	;is LN_PRED needed?

NoSucc:
	move.l	a1,d1			;the predecessor
	beq	ItsAlone

	move.l	#0,LN_SUCC(a1)		;now _you_ don't have a successor..
	bra	FreeProofMemOver

ItsAlone:
	move.l	#0,d0
NoPred:
	move.l	d0,KickMemPtr(a6)

	jsr	_LVOSumKickData(a6)		;do checksumming
	move.l	d0,KickCheckSum(a6)		;fill in

	jsr	_LVOCacheClearU(a6)		;clear caches..

FreeProofMemOver:
	jsr	_LVOPermit(a6)
	move.l	d3,a1			;list memory ptr
	move.l	d2,d0
	jsr	_LVOFreeMem(a6)

	move.l	#RemovedKickMemTxt,d1
	bsr	ShowDOSInfo

	move.l	d5,a1			;main memory ptr
	move.l	d4,d0
	bra	FreeNow

FreeProofMemFailed:
	jsr	_LVOPermit(a6)

	tst.l	Force
	bne	FreeProofMemFailedForReal

	move.l	#1,Force		;no looping!
	subi.l	#8,d5			;8 bytes earlier
	addi.l	#8,d4			;8 bytes more

	bra	FreeProofMem


FreeProofMemFailedForReal:
	move.l	#NotFoundTxt,d1
	bsr	ShowDOSInfo

	bra	Failed

Error:
	moveq	#10,d0
	rts


ShowDOSInfo:
	move.l	_DOSBase,a6
	move.l	d1,-(sp)
	move.l	d4,d0
	move.l	#LTS_HEX,d1
	lea	SizeBuffer,a0
	bsr	AnyLongToStr

	move.l	d5,d0
	move.l	#LTS_HEX,d1
	lea	PtrBuffer,a0
	bsr	AnyLongToStr

	move.l	(sp)+,d1
	move.l	#VPArray,d2
	jsr	_LVOVPrintf(a6)

	move.l	_SysBase,a6
	rts


**********************************************************************
*
*	AnyStrToLong - convert ASCII string to 32-bit value
*
* Input:  a0 - null terminated string
* Output: d0 - the value, or $FFFFFFFF if error
*         d1 - success (boolean)
*
*	As string you can pass decimal (no prefix), binary (prefix '%')
* or hex (prefixes '$' or '0x'). Check d1 for success or failure (fails
* when non-specific characters are found, or if null string).
*	In hex/bin mode, when you pass too many characters, only last
* 8/32 are used. In dec mode, maximal value is 4.294.967.295
* ($FFFFFFFF). Decimal values may be negative (prefix '-'), then the
* range is from -2.147.483.647 to 2.147.483.648 (otherwise the result
* is not reliable).
*
*	Alters only scratch registers (d0, d1, a0, a1). Uses 16 bytes
* of stack (decimal mode only).
*
*
*	© 1996 by Tadek Knapik (tadek@student.uci.agh.edu.pl).
*		 Public Domain. E-mail appreciated :-)
*
**********************************************************************



AnyStrToLong:
	tst.b	(a0)			;null string?
	beq	AnyStrToLongError

	moveq	#0,d0			;negative flag in decimal mode

	cmpi.b	#'-',(a0)		;negative?
	beq	DecStrToLong0

	cmpi.b	#'%',(a0)		;binary?
	beq	BinStrToLong0		;yes!

	cmpi.b	#'$',(a0)		;hex
	beq	HexStrToLong0		;yes!

	cmpi.b	#'0',(a0)		;hex (0x)
	bne	DecStrToLong		;no!

	movea.l	a0,a1			;string pointer
	addq.l	#1,a1
	cmpi.b	#'x',(a1)		;'x'?
	beq	HexStrPrefix		;

HexStrPrefix:
	cmpi.b	#'X',(a1)		;'X'?
	bne	DecStrToLong

	addq.l	#2,a0			;omit '0x'
	bra	HexStrToLong


;--------------------

;convert hex to long.

HexStrToLong0:
	addq.l	#1,a0			;next byte (omit '$')

HexStrToLong:
	moveq	#0,d0
	moveq	#0,d1

HexNextNybble:
	tst.b	(a0)			;the end?
	beq	AnyStrToLongEnd		;yes

;next character

	lsl.l	#4,d0			;prepare next 4 bits
	moveq	#0,d1			;clr
	move.b	(a0)+,d1		;next cipher

	cmpi.b	#'0',d1			;lower than 0?
	blt	AnyStrToLongError

	cmpi.b	#'f',d1			;higher than f?
	bgt	AnyStrToLongError

	subi.b	#'0',d1			;ASCII '0'
	bmi	AnyStrToLongError

;now we have 0-9. Or not..

	cmpi.b	#9,d1			;more than '9'?
	ble	HexReady		;no, we're done

	subi.b	#7,d1			;try this

;If A-F, we have 10-15, unless <, >, @ etc., or a-f

	cmpi.b	#10,d1			;less than 'A'?
	blt	AnyStrToLongError	;yes, jump @ Error

	cmpi.b	#15,d1			;more than 'F'
	ble	HexReady		;OK

;so, probably a-f

	subi.b	#32,d1			;case change?

	cmpi.b	#10,d1			;less?
	blt	AnyStrToLongError	;yes, probably XYZ

	cmpi.b	#15,d1			;more than 'f'
	ble	HexReady		;no, OK
	bra	AnyStrToLongError	;error, probably xyz

;in d1 we have value in range 0-15

HexReady:
	or.b	d1,d0			;set those bits
	bra	HexNextNybble		;next one, please


AnyStrToLongError:
	move.l	#-1,d0			;if -1 in d0, then 
	moveq	#0,d1			;d1 is boolean failure
	rts

AnyStrToLongEnd:
	moveq	#1,d1			;
	rts

;--------------------

;convert binary to long.

BinStrToLong0:
	addq.l	#1,a0			;next byte
BinStrToLong:
	tst.b	(a0)			;nothing?
	beq	AnyStrToLongError

	moveq	#0,d0
	moveq	#0,d1

BinNextBit:
	tst.b	(a0)			;coô jeszcze
	beq	AnyStrToLongEnd

;what do we have here..

	lsl.l	#1,d0			;prepare next bit

	moveq	#0,d1
	move.b	(a0)+,d1

	subi.b	#'0',d1			;
	bmi	AnyStrToLongError

	cmpi.b	#1,d1			;more than 1?
	bgt	AnyStrToLongError

;now we have 0 or 1 in d1.

	or.b	d1,d0			;to set or not to set
	bra	BinNextBit

;--------------------


;Convert decimal ASCII to 32 bit long.
;Maximum - 4.294.967.295 ($FFFFFFFF)
;If you pass in [x*4.294.967.295+y], it will probably return [y].


DecStrToLong0:
	addq.l	#1,a0			;next byte (omit '-')
	moveq	#1,d0

DecStrToLong:
	tst.b	(a0)			;nic?
	beq	AnyStrToLongError
	movem.l	d2-d5,-(sp)
	move.l	d0,d5			;negative flag

	moveq	#0,d1			;clr
	moveq	#0,d0			;the value
	movea.l	a0,a1			;string
	addq.l	#1,a1			;cause I add immediately

;length of the string without last null character

DecStrLengthLoop:
	addq.l	#1,d1
	tst.b	(a1)+
	bne	DecStrLengthLoop	

;now in d1 we have the weight  of the first cipher plus 1

DecNextCipherLoop:
	subq.l	#1,d1			;sub 1

	tst.l	d1			;if null, this is the last one
	beq	DecLastCipher
	move.l	d1,d2

	moveq	#0,d3
	move.b	(a0)+,d3		;the cipher

	subi.b	#'0',d3			;
	bmi	DecStrToLongError	;

	cmpi.b	#9,d3			;
	bgt	DecStrToLongError


DecMultipleLoop:
	move.l	d3,d4			;copy it

	lsl.l	#3,d3			;*8
	lsl.l	#1,d4			;*2
	add.l	d4,d3			;x*2+x*8=x*(2+8)=x*10

	subq.l	#1,d2
	bne	DecMultipleLoop

	add.l	d3,d0			;
	bra	DecNextCipherLoop


DecLastCipher:
	moveq	#0,d3
	move.b	(a0)+,d3

	subi.b	#'0',d3			;
	bmi	DecStrToLongError	;

	cmpi.b	#9,d3			;
	bgt	DecStrToLongError

	add.l	d3,d0

DecStrToLongEnd:
	tst.l	d5				;was it negative?
	beq	DecStrToLongPositiveEnd		;
	neg.l	d0				;negate it

DecStrToLongPositiveEnd:
	movem.l	(sp)+,d2-d5
	bra	AnyStrToLongEnd

DecStrToLongError:
	movem.l	(sp)+,d2-d5
	bra	AnyStrToLongError

**********************************************************************

**********************************************************************
*
*	AnyLongToStr - Convert 32-bit value to ASCII
*
* Input:  d0 - the value to convert
*         d1 - flags
*         a0 - pointer to a buffer 
* Output: d0 - number of characters written (or null for error)
*         a0 - address of the terminating null
*
*
*	Flags are:
*   LTS_DECIMAL   - normal decimal conversion
*   LTS_SIGN_LONG - decimal signed mode (longword)
*   LTS_SIGN_WORD - signed (word)
*   LTS_SIGN_BYTE - signed (byte)
*   LTS_BINARY    - convert to binary
*   LTS_HEX_UPPER - convert to hex (A-F)
*   LTS_HEX_LOWER - convert to hex (a-f)
*
*
*	You should pass a buffer with at least 11/12 (decimal/negative
* decimal), 9 (hex) or 33 (binary) bytes of space.
*	If flags = #1, checks the 31 bit and if it is high, assumes
* the  value is lower than 0.
*	This string is null-terminated. Address of the terminating
* null is returned in a0. The null is included in number of chars
* written.
*
*	When you specify decimal non-signed mode, then even if
* bit 31 is set you'll get value in range 0 to 4.294.967.295. In
* signed mode you'll get values in range from -2.147.483.647 to
* 2.147.483.648 (negative when bit 31/15/7 is set, depending on the
* choosen mode). Minus sign is written, if needed (and added to chars
* counter returned in d0).
*
*	No prefix is written in hex/bin mode!!! If you need it, write
* it yourself. That's how you can choose between '$'/'0x' :-)
*
*	Alters only scratch registers (d0, d1, a0, a1). Uses 12 bytes
* of stack.
*
*
*	© 1996 by Tadek Knapik (tadek@student.uci.agh.edu.pl).
*		 Public Domain. E-mail appreciated :-)
*
**********************************************************************


LTS_DECIMAL	equ	0
LTS_BINARY	equ	2
LTS_HEX_UPPER	equ	4
LTS_HEX_LOWER	equ	8
LTS_SIGN_LONG	equ	16
LTS_SIGN_WORD	equ	32
LTS_SIGN_BYTE	equ	64
LTS_NEGATIVE	equ	LTS_SIGN_LONG
LTS_HEX		equ	LTS_HEX_UPPER


AnyLongToStr:
	movem.l	d2-d4,-(sp)
	moveq	#0,d2			;the counter

	cmpi.l	#LTS_DECIMAL,d1
	beq	LTSDecConvert

	cmpi.l	#LTS_SIGN_LONG,d1
	beq	LTSMinDecConvert

	cmpi.l	#LTS_SIGN_WORD,d1
	beq	LTSMinWDecConvert

	cmpi.l	#LTS_SIGN_BYTE,d1
	beq	LTSMinBDecConvert

	cmpi.l	#LTS_BINARY,d1
	beq	LTSBinConvert

	move.l	#'A',d2			;ASCII base uppercased

	cmpi.l	#LTS_HEX_UPPER,d1
	beq	LTSHexConvert

	move.l	#'a',d2			;ASCII base lowercased

	cmpi.l	#LTS_HEX_LOWER,d1
	beq	LTSHexConvert

LTSError:
	movem.l	(sp)+,d2-d4
	moveq	#0,d1
	moveq	#0,d0
	rts

;--------------------

LTSMinBDecConvert:
	ext.w	d0			;extend to word
LTSMinWDecConvert
	ext.l	d0			;extend to longword

LTSMinDecConvert:
	btst	#31,d0
	beq	LTSDecConvert
	move.b	#'-',(a0)+		;the minus sign
	addq.l	#1,d2
	neg.l	d0			;so I need plus now

LTSDecConvert:
	moveq	#0,d1			;zeroes flag
	move.l	#1000000000,d4		;32-bit max power of 10

LTSDecAgain:
	cmp.l	d4,d0
	bcc	LTSDecMatch

	tst.l	d1			;write zeroes?
	beq	LTSDecNextPass		;not yet

	move.b	#'0',(a0)+		;write it
	addq.l	#1,d2			;one character more
	bra	LTSDecNextPass

LTSDecMatch:
	moveq	#1,d1			;means write zeros from now
	moveq	#0,d3			;clear temporary

LTSDecLoop:
	addq.l	#1,d3			;

	sub.l	d4,d0
	bpl	LTSDecLoop		;branch if not less than 0

	add.l	d4,d0			;did it too many times
	subq.l	#1,d3			;as well

	addi.l	#'0',d3			;ASCII 0
	move.b	d3,(a0)+
	addq.l	#1,d2			;the counter

LTSDecNextPass:
	bsr	LTSDecDivideByTen
	tst.l	d4
	beq	LTSError

	cmpi.l	#1,d4
	bne	LTSDecAgain

;less than 10 in d0..

	addi.l	#'0',d0
	move.b	d0,(a0)+
	addq.l	#1,d2

LTSDecOver:
	move.b	#0,(a0)
	suba.l	#1,a0
	addq.l	#1,d2			;null is a character, too
	move.l	d2,d0
	movem.l	(sp)+,d2-d4
	rts


LTSDecDivideByTen:

;
;if your proggy is to be run on 020+ only!
; But beware! It is one of instructions not present on 68060! And it
;will be significantly slower, because it is emulated in software then.
;
;	divu.l	#10,d4
;	rts

;now 68000 part. Thanks for Simon N Goodwin for this routine!

	moveq   #0,d3			;temporary register
	swap    d4			;higher 16 bits
	move.w  d4,d3			;
	divu    #10,d3                  ;divide higher 16 bits
	swap    d3			;store in high word of d3
	move.w  d3,d4			;safe?
	swap    d4			;
	divu    #10,d4                  ;divide lower 16 bits
	move.w  d4,d3			;
	exg	d3,d4			;
	rts


;--------------------

LTSHexConvert:
	move.l	#8,d4			;8 characters

LTSHexLoop:
	rol.l	#4,d0			;prepare next nybble

	move.l	d0,d1			;spare
	andi.l	#$0000000F,d1		;the nybble

	move.l	#'0',d3			;ASCII base (for 0-9)

	cmpi.l	#9,d1			;normal or a-f
	ble	LTSHexDec

	move.l	d2,d3			;new base (A-F or a-f)
	subi.l	#$A,d1			;new value :-)

LTSHexDec:
	add.l	d1,d3			;add soup base, cover it and
	move.b	d3,(a0)+		;wait for 3 minutes :-)

	subq.l	#1,d4			;
	bne	LTSHexLoop

	move.b	#0,(a0)			;terminate
	suba.l	#1,a0			;
	movem.l	(sp)+,d2-d4		;give it back..
	move.l	#9,d0			;no way for 8 :-)
	rts

;--------------------


LTSBinConvert:
	move.l	#32,d4			;8 characters

LTSBinLoop:
	rol.l	#1,d0			;one bit

	move.l	d0,d1			;spare
	andi.l	#$00000001,d1		;the bit

	move.l	#'0',d3			;ASCII base

	add.l	d1,d3			;do it again
	move.b	d3,(a0)+		;

	subq.l	#1,d4			;
	bne	LTSBinLoop

	move.b	#0,(a0)			;terminate
	suba.l	#1,a0			;
	movem.l	(sp)+,d2-d4		;give it back..
	move.l	#33,d0			;am I sure of that?
	rts


**********************************************************************





;copying string (from a0 to a1), util null or EOL (replaced by null in
;the destination). Returns number of copied characters in D0 (along with 
;the last null). A1 contains a pointer lastnull+1 (one byte after the
;null)
;

CopyString:
	clr.l	d0			;clear the counter
CopyStringLoop:
	cmpi.b	#10,(a0)
	beq	CopyStringOver
	addq.l	#1,d0			;increment
	move.b	(a0)+,(a1)+
	beq	CopyStringEnd
	bra	CopyStringLoop
	
CopyStringOver:
	addq.l	#1,a0			;next char
	move.b	#0,(a1)+		;terminate
	addq.l	#1,d0			;include null in count
CopyStringEnd:
	rts


FreeArgs:
	move.l	_DOSBase,a6
	move.l	_ReadArgs,d1
	jsr	_LVOFreeArgs(a6)
	rts


OpenDOS:
	move.l	_SysBase,a6
	lea	DOSName,a1
	move.l	#KICKVERSION,d0
	jsr	_LVOOpenLibrary(a6)
	rts

CloseDOS:
	move.l	_SysBase,a6
	move.l	_DOSBase,a1
	jsr	_LVOCloseLibrary(a6)
	rts



	section	AllocAbsd,data

IDString:
	dc.b	'Allocated with AllocAbs v1.1!',0
IDStringEnd:

DOSName:
	dc.b	'dos.library',0
Template:
	dc.b	'A=ADDRESS/K/A,S=SIZE/K/A,RIP=RESETPROOF/S,US=UNSAFE/S,FORCE/S,FREE/S',0

AllocOKTxt:
	dc.b	'Allocated %s bytes at %s.',10,0
AddedKickMemTxt:
	dc.b	'Memory added to KickMemPtr list.',10,0
AllocFailedTxt:
	dc.b	'Allocating %s bytes at %s failed!',10,0
FreedOKTxt:
	dc.b	'Freed %s bytes at %s.',10,0
RemovedKickMemTxt:
	dc.b	'Memory removed from KickMemPtr list.',10,0
NotFoundTxt:
	dc.b	'Memory has not been found on KickMemPtr list!',10,0
AllocRIPFailedTxt:
	dc.b	'Not enough memory for Resident structure!',10,0
NoRIPTypeTxt:
	dc.b	"This memory block can't be made reset proof!",10,0

VPArray:
	dc.l	SizeBufferFull
	dc.l	PtrBufferFull
	dc.l	0			;nwp

SizeBufferFull:
	dc.b	'$'
SizeBuffer:
	ds.b	16
PtrBufferFull:
	dc.b	'$'
PtrBuffer:
	ds.b	16


	section	AllocAbsb,bss

ArgsArray:
Address:
	ds.l	1
Size:
	ds.l	1
Proof:
	ds.l	1
UnSafe:
	ds.l	1
Force:
	ds.l	1
Free:
	ds.l	1

_SysBase:
	ds.l	1

_DOSBase:
	ds.l	1

_ReadArgs:
	ds.l	1

KickVer:
	ds.w	1


