X2:
JMP RUN
x1:
move  #0,$2000
move.l #38000,d1
rts
schleife:
add #2,$2000
cmp $2000,d1
bne schleife
rts
led:
or.b #2,$bfe001
jsr schleife
jsr x1
andi.b #253,$bfe001
jsr schleife
andi.b #64,$bfe001
bne led
rts
;Digitized Soundroutine
;
;by The Deprotector of the BEYONDERS
;written on  8-August-1987
;Greetings to all our Swap Friends
; 
MaxSnd=112664
SndBuffer=$50000
; ---- exec.library 
AbsExecBase=$4
OpenLibrary=-408
CloseLibrary=-414
; ---- dos.library
Open=-30
Close=-36
Read=-42
OPEN_OLD=1005
; ---- Program Entry Point !
run:
  move.l sp,initialSP
  move.l AbsExecBase,a6
  lea    DosName,a1
  jsr    OpenLibrary(a6)
; ---- Load Digitized Data in ram
  move.l d0,a6
  move.l #FileName,d1
  move.l #OPEN_OLD,d2
  jsr    Open(a6)
  move.l d0,d7
  move.l d0,d1
  move.l #SndBuffer,d2
  move.l #MaxSnd,d3
  jsr    Read(a6)
  lsr.l  #1,d0
  move.w d0,SndLen  ; len in words 
  move.l d7,d1
  jsr    Close(a6)
  move.l a6,a1
  move.l AbsExecBase,a6
  jsr    CloseLibrary(a6)
  jmp start
; --- Data area
FileName: DC.B 'df0:yello3',0
  even
DosName: DC.B 'dos.library',0
  even
SndLen: blk.w 1
OldVector: blk.l 1,0
initialSP: blk.l 1,0
timer: blk.w 1,0
start:	move.l	#$50000,$dff0a0
	move.l  #$50000,$dff0b0
	move.l	#$5012c,$dff0c0
	move.l	#$50000,$dff0d0
	move.l	#112664,d7
	lsr.l	#1,d7
	move.w	d7,$dff0a4
	move.w	d7,$dff0c4
	move.w  d7,$dff0b4
	move.w  d7,$dff0d4
	move.w	#340,$dff0a6
	move.w  #340,$dff0c6
	move.w  #340,$dff0b6
	move.w  #340,$dff0d6
	move.w	#64,$dff0a8
	move.w  #64,$dff0c8
	move.w	#64,$dff0b8
	move.w  #64,$dff0d8
	move.w	#%1000000000001111,$dff096

wait:	andi.b #64,$bfe001
	jsr x1
        jsr led
        bne wait

	move.w #64,d0
no:	move.w #10000,d1
p1:	sub #1,d1
	bne p1
	move.w d0,$dff0a8
	move.w d0,$dff0b8
	move.w d0,$dff0c8
	move.w d0,$dff0d8
	sub #1,d0
	bne no

	move.w #%0000000000001111,$dff096
	illegal
	rts
