master
Your Name 6 years ago
parent 03b2e723b0
commit c556977497

Binary file not shown.

@ -20,21 +20,13 @@ start:
in al, 61h in al, 61h
or al, 00000011b or al, 00000011b
out 61h, al ; Send the new value out 61h, al ; Send the new value
; mov bx, 200 ; Pause for duration of note.
mov al, 0
mov al, 0 mov ah, 86h
mov ah, 86h mov cx, 1
mov cx, 1 mov dx, 200
mov dx, 200 int 15h
int 15h
;.pause1:
; mov cx, 65535
;.pause2:
; dec cx
; jne .pause2
; dec bx
; jne .pause1
in al, 61h ; Turn off note (get value from in al, 61h ; Turn off note (get value from
; port 61h). ; port 61h).
and al, 11111100b ; Reset bits 1 and 0. and al, 11111100b ; Reset bits 1 and 0.

Binary file not shown.

@ -22,11 +22,41 @@ start:
out 61h, al ; Send the new value out 61h, al ; Send the new value
; mov bx, 200 ; Pause for duration of note. ; mov bx, 200 ; Pause for duration of note.
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, 12h ; YellowOnBlue
int 10H ; execute interrupt
mov al, 0
mov ah, 86h
mov cx, 1
mov dx, 200
int 15h
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, 2Bh ; YellowOnBlue
int 10H ; execute interrupt
mov al, 0 mov al, 0
mov ah, 86h mov ah, 86h
mov cx, 1 mov cx, 1
mov dx, 200 mov dx, 200
int 15h int 15h
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, 3Fh ; YellowOnBlue
int 10H ; execute interrupt
mov al, 0
mov ah, 86h
mov cx, 1
mov dx, 200
int 15h
;.pause1: ;.pause1:
; mov cx, 65535 ; mov cx, 65535
@ -41,6 +71,14 @@ int 15h
out 61h, al ; Send new value. out 61h, al ; Send new value.
mov al, 0
mov ah, 86h
mov cx, 1
mov dx, 200
int 15h
waitforkey: waitforkey:
mov ah, 0x00 mov ah, 0x00
int 0x16 int 0x16

Binary file not shown.

@ -123,6 +123,8 @@ waitforkey:
je .down je .down
cmp ah, 1Ch cmp ah, 1Ch
je loadproject je loadproject
cmp ah, 01h
je goback
jmp waitforkey jmp waitforkey
.up .up
@ -249,7 +251,13 @@ print:
exit: exit:
ret ret
msg1 db "ARTIST / TITLE",0 goback:
mov dl, [bootdev]
jmp 0x0:0x7c00
hlt
msg1 db "ARTIST / TITLE",0
project1 db "Alex / Poetic Software",0 project1 db "Alex / Poetic Software",0
project2 db "Alice / f00d",0 project2 db "Alice / f00d",0
@ -261,9 +269,9 @@ project6 db "Zalan / Phantasmagoria", 0
projects dq project1, project2, project3, project4, project5, project6 projects dq project1, project2, project3, project4, project5, project6
menuhelp db "F1 Help", 0 menuhelp db "F1 Help", 0
menuselect db " W/S Select Item",0 menuselect db " W/S Select Item",0
menuexit db 0x0D,0x0A," ESC Exit", 0 menuexit db 0x0D,0x0A," ESC Exit", 0
menuenter db " Enter publication",0 menuenter db " Enter Select",0
wolf_error_msg db 'Program not found!',0x0D,0x0A,0 wolf_error_msg db 'Program not found!',0x0D,0x0A,0
wolf_error_msg1 db 'Press any key to restart..',0 wolf_error_msg1 db 'Press any key to restart..',0
@ -277,4 +285,3 @@ bootdev db 0x80 ; Boot device number
%assign usableMemory (512*16) %assign usableMemory (512*16)
%warning [usedMemory/usableMemory] Bytes used %warning [usedMemory/usableMemory] Bytes used
times (512*16)-($-$$) db 0 ;kernel must have size multiple of 512 so let's pad it to the correct size times (512*16)-($-$$) db 0 ;kernel must have size multiple of 512 so let's pad it to the correct size

@ -0,0 +1,286 @@
[org 0x1000]
start:
mov [bootdev], dl
mov ah, 01h ;make cursor invisible
mov cx, 2607h
int 10h
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, 1Eh ; YellowOnBlue
int 10H ; execute interrupt
mov ah, 06h ;draw rect on background
mov cx, 0101h
mov dx, 124Dh
mov bh, 3Eh
int 10h
mov ah, 06h ;draw shadow
mov cx, 1302h
mov dx, 134Eh
mov bh, 0Eh
int 10h
mov ah, 06h ;draw shadow
mov cx, 024Eh
mov dx, 134Eh
mov bh, 0Eh
int 10h
; menu bottom
mov ah, 06h ;draw rect on background
mov cx, 1700h
mov dx, 184Fh
mov bh, 3Fh
int 10h
mov ah, 02h ;sets cursor to top to write
mov bh, 0h
mov dh, 17h
mov dl, 2h
int 10h
mov si, menuhelp
call print
mov si, menuselect
call print
mov si, menuexit
call print
mov si, menuenter
call print
mov ah, 02h ;sets cursor to top to write
mov bh, 0h
mov dh, 4h
mov dl, 4h
int 10h
mov si, msg1
call print
print_projects:
mov ah, 02h ;sets cursor to top to write
mov bh, 0h
mov dh, 6h ;row
mov dl, 4h ;col
int 10h
xor bx, bx ; Starting at offset zero
lea di, [projects] ; RDI now has the address of the array
.loop
mov [storebx], bx
mov ah, 02h
;mov bh, 0h
add dh, 1h ;move cursor down
mov dl, 4h;
int 10h
mov ax, [currentselection]
cmp ax, bx
jne .normalbackground
mov ah, 06h ;draw rect on background
mov ch, dh
mov cl, 4h
mov dl, 24h
mov bh, 7Ch
int 10h
jmp .drawstring
.normalbackground
mov ah, 06h ;draw rect on background
mov ch, dh
mov cl, 4h
mov dl, 24h
mov bh, 1Eh
int 10h
jmp .drawstring
.drawstring
mov bx, [storebx]
mov si, [di+bx] ; Get the address of string1
call print
add bx, 8
cmp bx, 48
jne .loop
jmp waitforkey
waitforkey:
mov ah, 0x00
int 0x16
cmp ah, 1Fh
je .up
cmp ah, 11h
je .down
cmp ah, 1Ch
je loadproject
jmp waitforkey
.up
mov ax, [currentselection]
cmp ax, 40
je .reup
add ax, 8
mov [currentselection], ax
jmp print_projects
.reup
mov ax, 0
mov [currentselection], ax
jmp print_projects
.down
mov ax, [currentselection]
cmp ax, 0
je .redown
sub ax, 8
mov [currentselection], ax
jmp print_projects
.redown
mov ax, 40
mov [currentselection], ax
jmp print_projects
loadproject:
mov bx, [currentselection]
cmp bx, 0
je .one
cmp bx, 8
je .two
cmp bx, 16
je .three
cmp bx, 24
je .four
cmp bx, 32
je .five
cmp bx, 40
je .six
jmp waitforkey
.one
mov bx, 0x2000 ; BX = 0x1000. ES:BX=0x0:0x1000
mov cl, 04 ; Sector to read = 4
jmp load
.two
mov bx, 0x3000 ; BX = 0x1000. ES:BX=0x0:0x1000
mov cl, 05 ; Sector to read = 4
jmp load
.three
mov bx, 0x4000 ; BX = 0x1000. ES:BX=0x0:0x1000
mov cl, 06 ; Sector to read = 4
jmp load
.four
mov bx, 0x5000 ; BX = 0x1000. ES:BX=0x0:0x1000
mov cl, 07 ; Sector to read = 4
jmp load
.five
mov bx, 0x6000 ; BX = 0x1000. ES:BX=0x0:0x1000
mov cl, 08 ; Sector to read = 4
jmp load
.six
mov bx, 0x7000 ; BX = 0x1000. ES:BX=0x0:0x1000
mov cl, 09 ; Sector to read = 4
jmp load
load:
pushf
stc
mov ah,00
int 13h
.read_sector:
mov ax, 0x0
mov es, ax ; ES = 0
; ES:BX = starting address to read sector(s) in$
mov ah, 02 ; Int 13h/AH=2 = Read Sectors From Drive;
mov al, 0x01 ; Sectors to read = 1
mov ch, 00 ; CH=Cylinder. Second sector of disk
; is at Cylinder 0 not 1
mov dh, 00 ; Head to read = 0
mov dl, [bootdev]
int 13h
jc wolf_error
popf
jmp bx
cli
hlt
wolf_error:
mov si, wolf_error_msg
call print
mov si, wolf_error_msg1
call print
mov ah,00
int 16h
xor ax,ax
int 19h
print:
lodsb
or al,al
jz exit
mov ah,0x0e
int 10h
jmp print
exit:
ret
goback:
mov dl, [bootdev]
jmp 0x0:0x0000
msg1 db "ARTIST / TITLE",0
project1 db "Alex / Poetic Software",0
project2 db "Alice / f00d",0
project3 db "Angeliki / Voices", 0
project4 db "Joca / Ghost in the Speaker", 0
project5 db "Tash / Silence making", 0
project6 db "Zalan / Phantasmagoria", 0
projects dq project1, project2, project3, project4, project5, project6
menuhelp db "F1 Help", 0
menuselect db " W/S Select Item",0
menuexit db 0x0D,0x0A," ESC Exit", 0
menuenter db " Enter Select",0
wolf_error_msg db 'Program not found!',0x0D,0x0A,0
wolf_error_msg1 db 'Press any key to restart..',0
currentselection dw 0
storebx dw 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 let's pad it to the correct size

Binary file not shown.

@ -14,15 +14,15 @@ start:
or al, 00000011b or al, 00000011b
out 61h, al ; Send the new value out 61h, al ; Send the new value
mov al, 0 mov al, 0
mov ah, 86h mov ah, 86h
mov cx, 1 mov cx, 1
mov dx, 200 mov dx, 200
int 15h int 15h
in al, 61h ; Turn off note (get value from in al, 61h ; Turn off note (get value from
; port 61h). ; port 61h).
and al, 11111100b ; Reset bits 1 and 0. and al, 11111100b ; Reset bits 1 and 0.
out 61h, al ; Send new value. out 61h, al ; Send new value.
mov ah, 06h ; Scroll up function mov ah, 06h ; Scroll up function
@ -32,30 +32,30 @@ int 15h
mov bh, 9Bh ; YellowOnBlue mov bh, 9Bh ; YellowOnBlue
int 10H ; execute interrupt int 10H ; execute interrupt
mov ah, 02h ;sets cursor to top to write mov ah, 02h ;sets cursor to top to write
mov bh, 0h mov bh, 0h
mov dh, 2h mov dh, 2h
mov dl, 2h mov dl, 2h
int 10h int 10h
mov si, description mov si, description
call print call print
jmp waitforkey jmp waitforkey
print: print:
lodsb lodsb
or al,al or al,al
jz .exit jz .exit
mov ah,0x0e mov ah,0x0e
int 10h int 10h
jmp print jmp print
.exit: .exit:
ret ret
waitforkey: waitforkey:
mov ah, 0x00 mov ah, 0x00
int 0x16 int 0x16
cmp ah, 01h cmp ah, 01h
je exit je exit
jmp waitforkey jmp waitforkey
exit: exit:
@ -66,7 +66,7 @@ exit:
mov dl, [bootdev] mov dl, [bootdev]
jmp 0x0:0x1000 jmp 0x0:0x1000
description db "Poetic Software is a project .... . . . .",0 description db "Poetic Software is a project",0
bootdev db 0x80 ; Boot device number bootdev db 0x80 ; Boot device number

Binary file not shown.
Loading…
Cancel
Save