From c556977497ad269fef043570584274ac98f5b05a Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 24 Apr 2019 23:19:33 +0200 Subject: [PATCH] window --- .software.asm.swp | Bin 0 -> 1024 bytes beep.asm | 22 ++-- disk.img | Bin 737280 -> 737280 bytes light.asm | 38 ++++++ light.bin | Bin 81 -> 156 bytes program.asm | 15 ++- program.asm.save | 286 ++++++++++++++++++++++++++++++++++++++++++++++ program.bin | Bin 8192 -> 8192 bytes software.asm | 58 +++++----- software.bin | Bin 8192 -> 8192 bytes 10 files changed, 371 insertions(+), 48 deletions(-) create mode 100644 .software.asm.swp create mode 100755 program.asm.save diff --git a/.software.asm.swp b/.software.asm.swp new file mode 100644 index 0000000000000000000000000000000000000000..2ec5b2eef58a262bd155ee7e862d648890b02901 GIT binary patch literal 1024 zcmYc?$V<%2S1{7E)H7y40y{Jq7>e@qOOS+cG81)^ampb}6z8XvlqVLY>LnKEB8!i* MM?+vV1O_Gq0Al$I$N&HU literal 0 HcmV?d00001 diff --git a/beep.asm b/beep.asm index 81d65cf..7ceceea 100644 --- a/beep.asm +++ b/beep.asm @@ -20,21 +20,13 @@ start: 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 + + 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. diff --git a/disk.img b/disk.img index 270f8efd6da2c7b1271baad7595e4abd7d180e78..15247c19d5b5c457c04d667052dc47c8b1ad673c 100755 GIT binary patch delta 545 zcmZo@&~0eY-N3}e#40?Qg~{K&P3VOia3)(E|@V%)b==!FU67N+eC+gLWS zoE6x&Mev0RgwF=z8{Y1<3lr*;V;0`R)NqUuB(#uGc=9YJr4(l2Zo?P18JZ7sH2*dz z-T#_l3&UBlhClKp!VP}}OVk_w$duSL{9)v8In40-2~bn>4~-Iz<^vpy8HHar?qFa5 z(l0CigC!VBIGbO9BwnWf-=P7PiTmFz2ee3nS)Q?XvIVofEvxWZ;Ud<#{~!PQvhSkM z3qFQ@&xBrZfGssVa8_~+$AJ>IEqrGMUVlB@CB`cJilK&q;frHXh-Yw!g2Ln#%(FC) z3NnDf11S9gN;3&T#Fe15&E#wrc}9iFoh;gH!Kpc^$t9cjvluY4bcl5;Ocvx&o2GfBLWS7|Nf>#Uz3=9nr4=^-G2((8CFaj|X5HkZY a3lOscF&hxG12G2>a{@8f_6Py)SbYGRSG~Fb delta 432 zcmZo@&~0eY-N3}e^hIbg3zNTlkLElk@Pwy|tt zIV-Slk>Cp%2%inaH@w|z=OolA_ep3AQ^PSvkkG;pLX&4PDaCve>Nb3FnW6bGNAquk z(*3U)wlJI(YxpBy!qf0autdJ$k4%Zl>(@Zl%|A3sIGPV|EdC($x?=|e1Bh+_i!+pP zHopLgzs&!?Ljxr7GVOo29MA#QDE$sf^9e!ZH73`y z$WLCtqQzZMnv|27oLG{XpSSq}ivi>03ygv+9bz*SCJSu+x^c9Y}oe9c}FJ4GpCLR&zznl@-RP3M92#P1Q_j(~z!3<3-c4FE8`4#EHc diff --git a/program.asm b/program.asm index eaf752e..1fbf713 100755 --- a/program.asm +++ b/program.asm @@ -123,6 +123,8 @@ waitforkey: je .down cmp ah, 1Ch je loadproject + cmp ah, 01h + je goback jmp waitforkey .up @@ -249,7 +251,13 @@ print: exit: 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 project2 db "Alice / f00d",0 @@ -261,9 +269,9 @@ 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 +menuselect db " W/S Select Item",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_msg1 db 'Press any key to restart..',0 @@ -277,4 +285,3 @@ bootdev db 0x80 ; Boot device number %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 - diff --git a/program.asm.save b/program.asm.save new file mode 100755 index 0000000..97db58f --- /dev/null +++ b/program.asm.save @@ -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 diff --git a/program.bin b/program.bin index 15f2950d5fd4b1076f72c364fb2cd2c5846e7ac6..b6523ead9df50ae49891e4a431965327908a0c8d 100644 GIT binary patch delta 328 zcmZp0XmDWZ5Mvdd$l~wbCiKFMabLgC3kSx1YlL1{G49(b^umO33)6OnZ7iEu&I;_? zBKSfD!e;~V4R80_g$Z@aF$-^DYBJ5KnN^BbbF!Hw?W_bMssHgddMhQpr0glCt!mk^5Ffah=mlglP z5)37r%`ZR_FVp|;&;ZNC{qL4z6rL=>D9_kC*@DsDmR0zya1ra=|Brut*>_Rs1s}t{ zXF@MHz?K>wI4ik^<3I`97QV9rufHDd0($lpLk$DN7ssFw&)^URg~=-zXK5Z4WB`K) nQ2GOuW)gykD?w?S$=OWuj0%%GnY7u0Q*%<2OE&LkGLQuTQWwro`m+YoOxh9~vbb%?CIZe-L`zv4epDL^puN8A>>tUx374 z=KtTJ0g`x`_P<;1gV1CJMtR1mlN}iC4ZjGT6)s|(`~UH;FZ&J%z2IZmcU9;G2iP*h z17{`Ia2zOM+roEN;PuzTjzJ-w!6B3PFwWB4D98W?XQ1>QDE$sf^9e!ZH73_H$xmLu bq{UrOnv|27oLG{XpSSq}lY#7H1!h429}juL diff --git a/software.asm b/software.asm index 9498fd0..94ea2ca 100644 --- a/software.asm +++ b/software.asm @@ -14,15 +14,15 @@ start: 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 + 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. + and al, 11111100b ; Reset bits 1 and 0. + out 61h, al ; Send new value. mov ah, 06h ; Scroll up function @@ -32,30 +32,30 @@ int 15h 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 + 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 + 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 + mov ah, 0x00 + int 0x16 + cmp ah, 01h + je exit jmp waitforkey exit: @@ -66,7 +66,7 @@ exit: mov dl, [bootdev] 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 diff --git a/software.bin b/software.bin index 67e34dfe54f12a2f784a7f50beb96936042d2660..a0baf07a963d94831e50f0710b057578209224b3 100644 GIT binary patch delta 26 hcmZp0XmDWe5bK`EoWj^WF++)op<&~~c=?GNL;-ZZ2=o8| delta 36 kcmZp0XmDWe5SuZPIfZe?#0({V1w9~8fI^0bjT6)50lqT{%>V!Z