home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
texts
/
boxes
/
jb_test.a49
< prev
next >
Wrap
Text File
|
1993-06-05
|
1KB
|
58 lines
;BEGIN OF PAGE $000
;Resetroutine:
nop ; lo
nop ; hi-pointer to reset ($000)
nop ; lo
nop ; hi-pointer to nmi ($000)
nop
nop
nop
nop
nop
init: sel rb0 ; use old register
orl p1,=%11111111 ; %11111111 all bits for output
orl p2,=%11111111 ; %11111111 all bits for output
selftest:
clr a
mov r3,a
outl p1,a
testloop:
outl p2,a ;set tone
mov r1,a ;keep it
mov a,=250 ;0.5 sec delay
call wait
mov a,r1 ;get it back
add a,=%00010000 ;next sample
mov r1,a ;keep it
call silence ;sound off
mov a,=30
call wait ;pause 60ms
mov a,r3
outl p1,a
mov a,r1
jmp testloop ;loop
silence:mov A,=%11111111
outl p1,A
mov A,=$f0
outl p2,A
ret
wait: mov r2,=166 ; set loop of 5+166*8 cycles
wait1: nop ; delay 1 cycle
nop ; delay 1 cycle
nop ; delay 1 cycle
nop ; delay 1 cycle
nop ; delay 1 cycle
nop ; delay 1 cycle
djnz r2,wait1 ; delay 2 cycles
dec a ; after 1 #s, if a>0
jnz wait ; goto wait again
ret ; end of wait