Z80 Routines:Sound:Beep

From WikiTI
Revision as of 05:40, 13 July 2005 by Guillaumeh (Talk | contribs)

Jump to: navigation, search


By Joe Wingbermuehle (joewing@calc.org). This routine was written for the ZLib library for the SOS shell.

;---------= Make a sound =---------
; c=frequency, b=duration
beep:	di
	ld	e,$D0
beepl1:	ld	a,c
beepl2:	dec	a
	jr	nz,beepl2
	ld	a,e
	xor	%00000011
	ld	e,a
	out	(0),a
	djnz	beepl1
	ei
        ret