[SOLVED] PC speaker does not work
Posted: Mon Apr 02, 2018 9:33 am
Good day!
I tried to play sound from the PC speaker code:
BITS 16
(This is a function of MikeOS.) But the sound does not work. When I run MikeOS, so sound worked. Please what do I do?
I tried to play sound from the PC speaker code:
BITS 16
Code: Select all
start:
mov ax, 07C0h ; Set 4K stack space after this bootloader
add ax,, 288 ; (4096 + 512) / 16 apartments under paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; Set data segment to where we're loaded
mov ds, ax
mov ax, 1000
call os_speaker_tone
jmp $
os_speaker_tone:
pusha
mov cx, ax ; Store note value now
mov al, 182
out 43h, al
mov ax, cx ; Set the frequency
out 42h, al
mov al, ah
out 42h, al
in al, 61 h ; Switch PC speaker
or al, 03h
of the 61 h, al
popa
ret