dialer/beep.jrt

38 lines
788 B
Plaintext
Executable File

:asm >spk ( div -- )
MOV AL 0xb6 #
OUT 0x43 # AL
POP AX
OUT 0x42 # AL
MOV AL AH
OUT 0x42 # AL
IN AL 0x61 #
OR AL 0x03 #
OUT 0x61 # AL
NEXT
:asm freq>div ( f -- d )
MOV AX 0x34df #
MOV DX 0x12 #
POP BX
DIV BX
PUSH AX
NEXT
:asm silence ( -- )
IN AL 0x61 #
AND AL 0xfc #
OUT 0x61 # AL
NEXT
: slide ( freq count + -- )
>r swap freq>div swap begin over >spk 2 sleep-csec swap r@ + swap 1- dup not until
rdrop drop drop silence ;
: divboop ( count div ) >spk sleep-csec silence ;
: boop ( freq count -- ) swap freq>div divboop ;
: noise ( count -- )
begin rand >spk 1 sleep-csec 1- dup not until drop silence ;
: spk-arp ( f1 f2 count -- ) times each dup 1 boop swap next drop drop ;
deferred arp spk-arp