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.
222 lines
4.8 KiB
NASM
222 lines
4.8 KiB
NASM
[org 0x4000]
|
|
|
|
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, 1Ch ; 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
|
|
|
|
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, 02h ;top bar setting the position and then write title $
|
|
mov bh, 0h
|
|
mov dh, 0h
|
|
mov dl, 20h
|
|
int 10h
|
|
|
|
mov si, title
|
|
call print
|
|
|
|
|
|
mov ah, 02h ;sets cursor to top to write
|
|
mov bh, 0h
|
|
mov dh, 17h
|
|
mov dl, 2h
|
|
int 10h
|
|
|
|
mov si, menuexit
|
|
call print
|
|
|
|
|
|
|
|
main:
|
|
mov bx, 1
|
|
mov ah, 06h ;draw rect on background
|
|
mov cx, 060Fh
|
|
mov dx, 103Bh
|
|
mov bh, 70h
|
|
int 10h
|
|
push dx
|
|
push cx
|
|
mov si, description
|
|
call printinrect
|
|
pop cx
|
|
pop dx
|
|
push dx
|
|
push cx
|
|
call drawshadow
|
|
jmp waitforkey
|
|
pop cx
|
|
pop dx
|
|
|
|
|
|
drawshadow:
|
|
push cx
|
|
push dx
|
|
mov al, dl
|
|
mov ah, ch
|
|
inc ah
|
|
inc al
|
|
mov cx, ax
|
|
mov bl, dl
|
|
mov bh, dh
|
|
inc bl
|
|
inc bh
|
|
mov dx, bx
|
|
mov ah, 06h ;draw shadow
|
|
mov bh, 0Ch
|
|
int 10h
|
|
pop dx
|
|
pop cx
|
|
|
|
mov al, cl
|
|
mov ah, dh
|
|
inc ah
|
|
inc al
|
|
mov cx, ax
|
|
mov bl, dl
|
|
mov bh, dh
|
|
inc bl
|
|
inc bh
|
|
mov dx, bx
|
|
mov ah, 06h ;draw shadow
|
|
mov bh, 0Ch
|
|
int 10h
|
|
|
|
ret
|
|
|
|
|
|
printinrect:
|
|
mov ax, 0
|
|
mov [writtenchars], ax
|
|
push cx
|
|
mov bx, dx
|
|
push bx
|
|
mov ah, 02h ;sets cursor to top to write
|
|
mov bh, 0h
|
|
mov dh, ch
|
|
mov dl, cl
|
|
int 10h
|
|
.loop:
|
|
mov ax, [writtenchars]
|
|
inc ax
|
|
mov [writtenchars], ax
|
|
lodsb ; load next char
|
|
mov bh, 0
|
|
mov ah, 0x03
|
|
int 10h ;read cursor position
|
|
push dx
|
|
pop dx
|
|
pop bx
|
|
cmp dh, bh ;comp for scroll
|
|
jg .stop
|
|
push bx
|
|
push dx
|
|
or al,al
|
|
jz .exit
|
|
mov bx, [writtenchars]
|
|
cmp bx, [scrollchars]
|
|
jg .writechar
|
|
.continue:
|
|
pop dx
|
|
pop bx
|
|
cmp dl, bl ;if caracter over width of rect
|
|
je .newline ; go to next line
|
|
push bx
|
|
jmp .loop
|
|
|
|
.writechar:
|
|
mov ah, 0x0e
|
|
mov bh, 0x00
|
|
mov cx, 0x01
|
|
int 10h ;write char
|
|
jmp .continue
|
|
|
|
.stop:
|
|
pop cx
|
|
ret
|
|
.exit:
|
|
pop dx
|
|
pop bx
|
|
pop cx
|
|
ret
|
|
.newline:
|
|
pop cx
|
|
push bx
|
|
mov dl, cl ;set column
|
|
inc dh ;increment row by one, works!
|
|
mov ah, 02h ;sets cursor
|
|
mov bh, 0h ;page number 0 constant
|
|
int 10h
|
|
pop bx
|
|
push cx
|
|
push bx
|
|
jmp .loop
|
|
|
|
|
|
|
|
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
|
|
|
|
bootdev db 0x80 ; Boot device number
|
|
description db "Let's amplify unspeakable things challenges the default mode of authoritative voices, that establish exclusive speech platforms, through an intervention that creates a safe space for excluded voices to be explored, in situated meetings and on an online audio archive."
|
|
scroll db 1
|
|
scrollchars dw 0
|
|
writtenchars dw 0
|
|
menuhelp db "F1 Help", 0
|
|
menuselect db " ",0x18,"/",0x19," Select Item",0
|
|
menuexit db 0x0D,0x0A," ESC Exit", 0
|
|
menuenter db " Enter Select",0
|
|
|
|
title db "UPSETTING SETTINGS",0
|
|
|