我想用这个汇编程序制作“音乐”或更好的输出一点“哔”:
play.s:
datei:
.ascii "/dev/dsp"
.globl play
play:
movl $5, %eax
movl $datei, %ebx
movl $1, %ecx
int $0x80
pushl %eax
movl %eax, %ebx
movl $4, %eax
movl 12(%esp), %ecx
movl 8(%esp), %edx
int $0x80
音乐.s:
.globl _start
#.lcomm buffer, 100
buffer:
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
.byte 0,255,0,255,0,255,0,255,0,255
_start:
pushl $buffer
pushl $100
loop:
call play
jmp loop
movl $1, %eax
movl $0, %ebx
int $128
我组装了两个:
as music.s -o music.o as play.s -o play.o
并与:
ld play.o 音乐.o -o 音乐
但后来我注册我没有“/dev/dsp”文件。那么pulseaudio中的/dev/dsp有什么类似的吗?