	.text
	.globl	_nap
_nap:	jsr	_lflush		; flush the output buffer
	movl	sp@(4),d0	; ms to delay for in d0
	cmpw	#999,d7
	jle	.L14
| call sleep to do the delay
	addw	#96,d0		; compensate for /1024 truncation
	asrl	#8,d0		; /1024 for seconds
	asrl	#2,d0
	movl	d0,sp@-
	jsr	_sleep
	addql	#4,sp
	rts
| delay loop for < 1 second
.L14:	asll	#8,d0		; *512 for 1 ms per count
	asll	#1,d0
.L20:	subql	#1,d0
	jgt	.L20
	rts

