*****************************************************
;
; Example program for testing the Cross64 assembler
;
; Plays a 4 bit sample
;
*****************************************************
	ORG $C000

PLAY	SEI
	LDA #$0B
	STA $D011
LOOP1	LDX #$00	; start from beginning of sample
LOOP2	LDA SINE,X
	STA $D418	; adjust audio chip volume
	LDY #$0C	; delay between each sample
DELAY	DEY
	BNE DELAY
	INX
	CPX #20		; length of sample
	BEQ LOOP1
	BNE LOOP2

SINE	.BYTE 8,11,13,14,15,15,15,14,13,11
	.BYTE 8,5,3,2,1,1,1,2,3,5

PULSE	.BYTE 0,0,0,0,0,0,0,0,0,0
	.BYTE 15,15,15,15,15,15,15,15,15,15
