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.
79 lines
1.9 KiB
NASM
79 lines
1.9 KiB
NASM
[org 0x2000]
|
|
|
|
start:
|
|
mov [bootdev], dl
|
|
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 al, 0
|
|
mov ah, 86h
|
|
mov cx, 1
|
|
mov dx, 200
|
|
int 15h
|
|
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 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, 9Bh ; YellowOnBlue
|
|
int 10H ; execute interrupt
|
|
|
|
mov ah, 02h ;sets cursor to top to write
|
|
mov bh, 0h
|
|
mov dh, 2h
|
|
mov dl, 2h
|
|
int 10h
|
|
mov si, description
|
|
call print
|
|
jmp waitforkey
|
|
|
|
print:
|
|
lodsb
|
|
or al,al
|
|
jz .exit
|
|
mov ah,0x0e
|
|
int 10h
|
|
jmp print
|
|
.exit:
|
|
ret
|
|
|
|
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
|
|
|
|
description db "Poetic Software is a project .... . . . .",0
|
|
|
|
bootdev db 0x80 ; Boot device number
|
|
|
|
%assign usedMemory ($-$$)
|
|
%assign usableMemory (512*16)
|
|
%warning [usedMemory/usableMemory] Bytes used
|
|
times (512*16)-($-$$) db 0 ;kernel must have size multiple of 512 so le$
|
|
|
|
|