	.globl	_ArgArrayInit
_ArgArrayInit:

	moveml	d5/d6/d7/a2/a3,sp@-
	movel	sp@(0x18),d7
	movel	sp@(0x1c),a3
	subl	a2,a2
	tstl	d7
	beq	Weiter104
	moveq	#1,d0
	cmpl	d0,d7
	bne	Weiterc0
	moveq	#0,d0
	bra	Weiter122
Weiterc0:
	movel	d7,d0
	asll	#2,d0
.if 0
	movel	d0,a4@(_CXLIB_argarray_size:W)
.else
	movel	d0,_CXLIB_argarray_size
.endif
	movel	#0x10000,d1
	movel	a6,sp@-
	movel	4:w,a6
	jsr	a6@(-0x2ac)		| exec, umschreiben !
					| AllocVec(byteSize=d0, attributes=d1)
	movel	sp@+,a6
.if 0
	movel	d0,a4@(_CXLIB_argarray:W)
.else
	movel	d0,_CXLIB_argarray
.endif
	beq	Weiter122
	moveq	#0,d6
	subql	#1,d7			| ??
	moveq	#0,d5
	bra	WeiterF8

WeiterE8:
.if 0
	movel	a4@(_CXLIB_argarray:W),a0
.else
	movel	_CXLIB_argarray,a0
.endif
	addl	d5,a0
	movel	a3@(4,d5:L),a0@
	addql	#1,d6
	addql	#4,d5

WeiterF8:
	cmpl	d7,d6
	bcs	WeiterE8
.if 0
	movel	a4@(_CXLIB_argarray:W),d0
.else
	movel	_CXLIB_argarray,d0
.endif
	bra	Weiter122

Weiter104:
	movel	a3@(0x24),a0
	movel	a0@(4),a0
	movel	a6,sp@-
.if 0
	movel	a4@(_IconBase:W),a6
.else
	movel	_IconBase,a6
.endif
	jsr     a6@(-0x4e)
	movel	sp@+,a6

					|       diskobj = GetDiskObject(name)
					|         D0                      A0

.if 0
	movel	d0,a4@(Data228:W)
.else
	movel	d0,Data228
.endif
	tstl	d0
	beq	Weiter120
	movel	d0,a0
	movel   a0@(0x36),a2

Weiter120:
	movel	a2,d0
Weiter122:
	moveml	sp@+,d5/d6/d7/a2/a3
	rts

	.globl _ArgArrayDone
_ArgArrayDone:
.if 0
	tstl	a4@(_CXLIB_argarray:W)
.else
	tstl	_CXLIB_argarray
.endif
	beq	Weiter13c
.if 0
	movel	a4@(_CXLIB_argarray:W),a1
.else
	movel	_CXLIB_argarray,a1
.endif
	movel	a6,sp@-
	movel	4:W,a6
	jsr	a6@(-0x2b2)		| FreVec (membl=a1)
	movel	sp@+,a6
Weiter13c:
.if 0
	movel	a4@(Data228:W),d0
.else
	movel	Data228,d0
.endif
	tstl	d0
	beq	Weiter14c
	movel	d0,a0
	movel	a6,sp@-
.if 0
	movel	a4@(_IconBase:W),a6
.else
	movel	_IconBase,a6
.endif
	jsr	a6@(-0x5a)		| FreeDiskObject (a0)
	movel	sp@+,a6
Weiter14c:
	rts

	.globl	_ArgString
_ArgString:
	linkw	a5,#0
	moveml	a2/a3,sp@-
	movel	a5@(8),a0       | eventuell anders herum
	movel	a5@(12),a1
	movel	a0,d0
	beq	Weiter176
	movel	a6,sp@-
.if 0
	movel	a4@(_IconBase:W),a6
.else
	movel	_IconBase,a6
.endif
	jsr	a6@(-0x60)	| FindToolType a0=toolTypeArray, a1=TypeName
	movel   sp@+,a6

	movel	d0,a3
	movel	a3,d0
	beq	Weiter176
	movel	a3,d0
	bra	Weiter17a

Weiter176:
	movel   a5@(0x10),d0
Weiter17a:
	moveml	sp@+,a2/a3
	unlk	a5
	rts

	.globl	_ArgInt
_ArgInt:
	linkw	a5,#0
	moveml	a2/a3,sp@-
	movel	a5@(8),a0
	movel	a5@(12),a1
	movel	a0,d0
	beq	Weiter1b2

	movel	a6,sp@-
.if 0
	movel	a4@(_IconBase:W),a6
.else
	movel	_IconBase,a6
.endif
	jsr	a6@(-0x60)	| FindToolType a0=toolTypeArray, a1=TypeName
	movel   sp@+,a6

	movel	d0,a3
	movel	a3,d0
	beq	Weiter1b2

	lea	a5@(0x10),a0
	movel	a0,d2
	movel	a3,d1
	movel	a6,sp@-
.if 0
	movel	a4@(_DOSBase:W),a6
.else
	movel	_DOSBase,a6
.endif
	jsr	a6@(-0x330)	| StrToLong
	movel	sp@+,a6

Weiter1b2:
	movel	a5@(0x10),d0
	moveml	sp@+,a2/a3
	unlk	a5
	rts


	.globl	_UserFilter
_UserFilter:
	linkw	a5,#-4
	moveml	a2/a3/a6,sp@-
	movel	a5@(8),a3
	subl	a2,a2
	movel	a3,d0

	beq	Weiter1de
	movel	a5@(12),a1
	movel	a3,a0

|	movel	a6,sp@-
.if 0
	movel	a4@(_IconBase:W),a6
.else
	movel	_IconBase,a6
.endif
	jsr	a6@(-0x60)	| FindToolType a0=toolTypeArray, a1=TypeName
|	movel   sp@+,a6


	movel	d0,a2

Weiter1de:
	movel	a2,d0
	beq	Weiter1e6
	movel	a2,a0
	bra	Weiter1ea

Weiter1e6:
	movel	a5@(0x10),a0
Weiter1ea:
	moveq	#1,d0
	subl	a1,a1
.if 0
	movel	a4@(_CxBase:W),a6
.else
	movel	_CxBase,a6
.endif
	jsr	a6@(-0x1e)
	moveml	sp@+,a2/a3/a6
	unlk    a5
	rts

	.data
	.even
	.globl _CXLIB_argarray
_CXLIB_argarray:
	.long 0
Data228:
	.long 0

	.comm _CXLIB_argarray_size,4


