SS
Size: a a a
SS
ЕК
ЕК
К
SS
К
ΔΒ
К
К
ЕК
ЕК
DS
//Play sound using built in speaker
static void play_sound(uint32_t nFrequence) {
uint32_t Div;
uint8_t tmp;
//Set the PIT to the desired frequency
Div = 1193180 / nFrequence;
outb(0x43, 0xb6);
outb(0x42, (uint8_t) (Div) );
outb(0x42, (uint8_t) (Div >> 8));
//And play the sound using the PC speaker
tmp = inb(0x61);
if (tmp != (tmp | 3)) {
outb(0x61, tmp | 3);
}
}
//make it shutup
static void nosound() {
uint8_t tmp = inb(0x61) & 0xFC;
outb(0x61, tmp);
}
//Make a beep
void beep() {
play_sound(1000);
timer_wait(10);
nosound();
//set_PIT_2(old_frequency);
}
DS
ЕК
//Play sound using built in speaker
static void play_sound(uint32_t nFrequence) {
uint32_t Div;
uint8_t tmp;
//Set the PIT to the desired frequency
Div = 1193180 / nFrequence;
outb(0x43, 0xb6);
outb(0x42, (uint8_t) (Div) );
outb(0x42, (uint8_t) (Div >> 8));
//And play the sound using the PC speaker
tmp = inb(0x61);
if (tmp != (tmp | 3)) {
outb(0x61, tmp | 3);
}
}
//make it shutup
static void nosound() {
uint8_t tmp = inb(0x61) & 0xFC;
outb(0x61, tmp);
}
//Make a beep
void beep() {
play_sound(1000);
timer_wait(10);
nosound();
//set_PIT_2(old_frequency);
}
DS
ЕК
mov al,0B0h
out 43h,al
mov al,1
out 42h,al
dec ax
out 42h,al
in al,61h
or al,3
out 61h,al
mov al,90h
out 43h,al
Вот это инициализация.out 42h,al
DS
DS
DS
AV