You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.6 KiB
NASM
61 lines
1.6 KiB
NASM
[org 0x5000]
|
|
|
|
start:
|
|
mov [bootdev], dl
|
|
mov ah, 06h ; Scroll up function
|
|
xor al, al ; Clear entire screen
|
|
xor cx, cx ; Upper left corner CH=row, CL=column
|
|
mov dx, 184FH ; lower right corner DH=row, DL=column
|
|
mov bh, 4Fh ; YellowOnBlue
|
|
int 10H ; execute interrupt
|
|
|
|
mov al, 182 ; meaning that we're about to load
|
|
out 43h, al ; prepare speaker for output
|
|
|
|
mov ax, 2153 ; frequency countdown value is stored in ax. It is calculated by
|
|
out 42h, al ; Output low byte.
|
|
mov al, ah ; Output high byte.
|
|
out 42h, al
|
|
|
|
in al, 61h
|
|
or al, 00000011b
|
|
out 61h, al ; Send the new value
|
|
; mov bx, 200 ; Pause for duration of note.
|
|
|
|
mov al, 0
|
|
mov ah, 86h
|
|
mov cx, 1
|
|
mov dx, 200
|
|
int 15h
|
|
|
|
;.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.
|
|
|
|
|
|
waitforkey:
|
|
mov ah, 0x00
|
|
int 0x16
|
|
cmp ah, 01h
|
|
je exit
|
|
jmp waitforkey
|
|
|
|
exit:
|
|
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.
|
|
mov dl, [bootdev]
|
|
jmp 0x0:0x1000
|
|
|
|
bootdev db 0x80 ; Boot device number
|
|
|