Commit 1ca2ba1e authored by j's avatar j

Add beep when escape is sent

parent 2aaae86c
......@@ -37,6 +37,8 @@ int 0x10
je .newline
cmp al, 0x08 ; delete character
je .change_color_mode
cmp al, 0x1b ; escape character
je .beep
jmp .nonewline
.change_color_mode:
......@@ -80,6 +82,32 @@ int 0x10
jmp .loop
.beep:
mov al, 182 ; Prepare the speaker for the
out 43h, al ; note.
mov ax, 4560 ; Frequency number (in decimal)
; for middle C.
out 42h, al ; Output low byte.
mov al, ah ; Output high byte.
out 42h, al
in al, 61h ; Turn on note (get value from
; port 61h).
or al, 00000011b ; Set bits 1 and 0.
out 61h, al ; Send new value.
mov bx, 5000 ; Pause for duration of note.
.pause1:
mov cx, 65535
.pause2:
dec cx
jne .pause2
dec bx
jne .pause1
in al, 61h ; Turn off note (get value from
; port 61h).
and al, 11111100b ; Reset bits 1 and 0.
out 61h, al ; Send new value.
jmp .loop
.nonewline:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment