Notes
![]() ![]() Notes - notes.io |
;Program Lagu Padamu Negri
;--------------------------------------------------------------------------------
;Goldy Tanjung Wijaya/1606878732
;==========================================================================================================
.model small
.stack 0E000h
.data
sol_tinggi dw 880 ;nada sol oktaf 2
fa_tinggi dw 987 ;nada fa oktaf2
mi_tinggi dw 1046 ;nada mi oktaf 2
re_tinggi dw 1174 ;nada re oktaf 2
do_tinggi dw 1318 ;nada do okttaf
sii dw 1396 ;nada si oktaf 1
la dw 1567 ;nada la oktaf 1
sol dw 1760 ;nada sol oktaf 1
fa dw 1975 ;nada fa oktaf 1
mi dw 2093 ;nada mi oktaf 1
do dw 2401
clock equ es:6Ch ;clock pada es
tone dw ? ;deklarasi variabel tone yang kosong
.code
delay proc ;untuk memberikan delay pada lagu
push ax ;meletakkan register ax pada stack
mov ax,40h ;mengosongkan register ax
mov es,ax ;memindahkan register ax ke segmen es
mov ax,[clock] ;memberikan nilai clock pertama
;ketukan pertama kali program dimulai
Ketukawal:
cmp ax, [clock]
mov cx, 2
je Ketukawal
;looping untuk delay
Loopdelay:
mov ax, [clock]
ketuk:
cmp ax,[clock]
je ketuk
loop Loopdelay
pop ax
ret
endp delay
;untuk membunyikan suara oleh sound card
sounder proc
push ax
in al, 61h
or al, 00000011b ;mengakses soundcard
out 61h, al ;mengirim control word untuk ganti frekuensi
mov al, 0B6h
out 43h, al
mov ax, [tone] ;tone merupakan acuan untuk mengambil nada dari acuan
out 42h, al ; mengirim lower byte
mov al, ah
out 42h, al ; mengirim upper byte
pop ax
ret
endp sounder
;agar suaranya mati
matisuara proc
in al,61h
and al, 11111100b ;menutup soundcard (invers dari akses soundcard)
out 61h, al
ret
endp matisuara
;ibaratnya kita bermain piano, ada yang menekan tuts nya
;pada bagian macro pencet ini tuts apa yang ditekan sudah diprogram
pencet macro p1
push bx
mov bx,[p1] ;memasukkan parameter berupa not yang ditekan ke bx
mov [tone],bx ;memasukkan bx ke tone agar bisa dibunyikan
pop bx
call sounder ;memanggil sounder agar hasil insertion ke bx dapat dibunyikan
endm
;=============================================================================================
;Penulisan lagu
;=============================================================================================
.startup
;memainkan lagu
mainkan:
pencet mi
call delay
call delay
call delay
call delay
call matisuara
pencet sol
call delay
call delay
call matisuara
pencet do
call delay
call delay
call delay
call delay
call matisuara
pencet la
call delay
call delay
call delay
call delay
call matisuara
pencet do_tinggi
call delay
call delay
call matisuara
pencet fa
call delay
call delay
call delay
call delay
call matisuara
pencet sii
call delay
call delay
call delay
call matisuara
call matisuara
pencet sii
call delay
call delay
call delay
call matisuara
pencet do_tinggi
call delay
call delay
call delay
call matisuara
pencet re_tinggi
call delay
call delay
call delay
call matisuara
pencet do_tinggi
call delay
call delay
call delay
call matisuara
.exit
end
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team