	incdir "ram:include/"
	include exec_lib.i
	include dos_lib.i

START
	movea.l	a0,a2			Parameter retten
	move.l	d0,d2

	lea	DOSName(pc),a1		DOS-Lib öffnen
	moveq	#33,d0
	CALLEXEC OpenLibrary
	tst.l	d0
	beq.s	ende9
	movea.l	d0,a6			a6: DOSBase

	cmpi.b	#'?',(a2)		'?' oder
	beq.s	print_usage
	cmp.b	#1,d2			kein Argument?
	beq.s	print_usage		=> Usage

atod:
	moveq	#0,d1			Dez-String in 32-Bit-Zahl umwandeln
.loop	move.b	(a2)+,d0
	subi.b	#'0',d0
	cmpi.b	#10,d0
	bhs.s	.finish
	mulu	#10,d1
	add.b	d0,d1
	bra.s	.loop
.finish
	CALLLIB	Delay

ende:
	movea.l	a6,a1			DOS-Lib schließen
	CALLEXEC CloseLibrary
ende9:	moveq	#0,d0			Ende des Progs
	rts


print_usage:				;Usage ausgeben
	CALLLIB Output
	move.l	d0,d1
	lea	text(pc),a0
	move.l	a0,d2
	moveq	#textlen,d3
	CALLLIB Write
	bra.s	ende


;*** Daten ***

DOSName: dc.b "dos.library",0
;für DOS-Befehl Version
	dc.b "$VER: Delay 1.1 (27.5.92  © Thies Wellpott)",0
text:	dc.b "Usage: Delay t    t in 1/50 seconds (max. 655350)", $a
textlen = *-text
	even

