Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试在 NASM x86_32 上使用正弦波形发出音调,我已经定义了这样的频率:
C: DW 4560 D: DW 4063 E: DW 3619 F: DW 3416 G: DW 3043 A: DW 2711 B: DW 2415 C.: DW 2280
我是 Linux 程序集的新手,我非常感谢所有的帮助,谢谢 :)
公式为:
y(t) = A * sin(2 * PI * f * t + shift)
(A是幅度,f频率(以赫兹为单位),t是时间,shift是相移)。
A
f
t
shift
数学运算需要什么?
您将需要乘法和正弦。
我会给你一些提示:
对于正弦,您可以使用FSIN,对于乘法FMUL。此外,在 x86_32 中,所有参数都在堆栈上传递。有了这些信息,您应该能够解决您的任务。
正弦波来源: https ://stackoverflow.com/a/50366375/13912132