Вы находитесь на странице: 1из 10

CvSU

Republic of the Philippines Since 1906


Cavite State University
Don Severino delas Alas Campus
Indang, Cavite Philippines 4122

Presented to the Department of Computer and Electronics Engineering (DCEE)


College of Engineering and Information Technology
Cavite State University

In Partial Fulfillment of the Requirements


In the Subject CSO with Assembly Language
Under Engr. Bienvenido Sarmiento

Velandres, Quinno Ross T.

OCTOBER 2015
MONOTONE PROGRAM LISTING
OF THE SONG

TAKE ME TO
CHURCH-
HOZIER
INTRODUCTION

Characterize by its complex and difficult to understand language and its structure

itself, assembly language slightly bears similarity with other high programming languages, the

only big difference is its portability and the coding of its program. Because this language brings

closer the programmer to the machine/parts inside the computer, the programmer can enable to

understand much better and much deeper the function of this language to the operations that are

going inside a computer or in the other way around, to understand what is going inside the

computer, its processes in data storage and its program execution.

Like any other languages in computer, assembly language can also perform a program

similar to the capabilities of the other languages of computer. But the thing is, it is difficult in

terms of the encoding of the program, the logical organization of it and the other things that it

makes it complicated. It is expected that its display output, in some other ways slightly differs

from that of other computer languages. But assembly language has more edge than higher level

of computer language in terms of the data size it consumes when performing a program or

storing a data.

On the contrary to what have stated above, assembly language plays a vital role in

understanding the microprocessor inside the computer. This means that if we can understand

how a microprocessor works, then we can create any program we desired using the assembly

language knowing also the principles, important terminologies, functions of each registers and all

of the things which are concerned in using this language.


OBJECTIVES

This project target and attained the following:

1. To create a program using the assembly language that outputs a monotone of the song

Take Me To Church by Hozier which can be playback or edit if desired.

2. To test the said program and check if it is correct in tune and speed.

CAPABILITIES

The program made can play the tune of the song Just Give Me A Reason. This program

can be edited if desired if the expected results is not met due to variations of the processor when

played in differrent computers using the text editor or notepad. The pitch or frequency and tempo

or speed can be set/changed if desired provided that TASM and TLINK are present in the file

folder because these things are very essential in making the program which the Command

Prompt is used or other emulator like emu 8086 for convenience.

CONSTANT AND LIMITATIONS

The program constants are the declaration of each frequency which corresponds

to a particular note. Each note has a particular frequency number. The boundaries or limitations

of this program is that tempo or its speed varies in different computers because it is expected that

these computers have different architectures and varies in microprocessor speed. Because of this,

the desired output cannot be met unless the duration of the note is manually edited all over again

in the computer you are working at.


CONCLUSION

Making a monotone program using the assembly language takes a lot of effort and

patience to attain the desired outcome or output of the song. Because of its degree of complexity,

it is difficult to comprehend and understand some codes at first, plus the factor that you have to

test it in a different computer with different specifications tantamount to a tedious task in editing

the duration of teach note, but as you go on in making the program, it can be concluded that the

program has a simple logic.

SAMPLE DISPLAY OUTPUT


PROGRAM LISTING
Take Me To Church Hozier
.model small mov ax, 740; F#5
.stack mov ax, 659; E5 mov bx, 80
.286 mov bx, 250 call note
call note
sseg SEGMENT STACK mov ax, 740; F#5
DB 15 DUP ("STACK---") mov ax, 659; E5 mov bx, 200
sseg ends mov bx, 150 call note
DSEG SEGMENT call note
mov ax, 659; E5
lyrics db " ",0dh,0ah mov ax, 494; B4 mov bx, 80
db " Take Me To mov bx, 150 call note
Church - Hozier ",0dh,0ah call note
db " mov ax, 740; F#5
",0dh,0ah mov ax, 494; B4 mov bx, 80
db " Take me to church mov bx, 100 call note
",0dh,0ah call note
db " I'll worship like a mov ax, 659; E5
dog at ",0dh,0ah mov ax, 659; E5 mov bx, 100
db " the shrine of your mov bx, 100 call note
lies ",0dh,0ah call note
db " I'll tell you my mov ax, 740; F#5
sins and you ",0dh,0ah mov ax, 587; D5 mov bx, 80
db " can sharpen your mov bx, 100 call note
knife ",0dh,0ah call note
db " Offer me that mov ax, 659; E5
deathless ",0dh,0ah mov ax, 659; E5 mov bx, 100
db " death mov bx, 200 call note
",0dh,0ah call note
db " Good God,let me mov ax, 740; F#5
give you ",0dh,0ah mov ax, 494; B4 mov bx, 80
db " my life mov bx, 100 call note
",0dh,0ah call note
db " mov ax, 784; G5
",0dh,0ah mov ax, 494; B4 mov bx, 250
db "Prepared mov bx, 100 call note
by:Quinno Velandres ",0dh,0ah call note
mov ax, 784; G5
mov ax, 740; F#5 mov bx, 120
WORDS EQU $ - LYRICS mov bx, 100 call note
DSEG ENDS call note
CSEG SEGMENT'CODE' mov ax, 587; D5
ASSUME CS:CSEG,SS:SSEG,DS:DSEG mov ax, 784; G5 mov bx, 100
mov bx, 100 call note
MAIN PROC FAR call note
PUSH DS mov ax, 659; E5
MOV AX,DSEG mov ax, 740; F#5 mov bx, 100
MOV DS,AX mov bx, 150 call note
MOV BX,00001H call note
LEA DX,LYRICS mov ax, 740; F#5
MOV CX,WORDS mov ax, 740; F#5 mov bx, 100
MOV AH,40H mov bx, 300 call note
INT 21H call note
mov ax, 784; G5
;1ST mov ax, 740; F#5 mov bx, 200
mov ax, 784; G5 mov bx, 300 call note
mov bx, 120 call note
call note mov ax, 988; B5
mov ax, 740; F#5 mov bx, 200
mov ax, 740; F#5 mov bx, 80 call note
mov bx, 100 call note
call note mov ax, 587; D5
mov ax, 659; E5 mov bx, 100
mov ax, 659; E5 mov bx, 100 call note
mov bx, 100 call note
call note mov ax, 659; E5
mov bx, 250 mov bx, 100
call note mov ax, 587; D5 call note
mov bx, 100
mov ax, 587; D5 call note mov ax, 740; F#5
mov bx, 100 mov bx, 80
call note mov ax, 659; E5 call note
mov bx, 200
mov ax, 784; G5 call note mov ax, 784; G5
mov bx, 100 mov bx, 250
call note mov ax, 494; B4 call note
mov bx, 100
mov ax, 784; G5 call note mov ax, 784; G5
mov bx, 250 mov bx, 120
call note mov ax, 494; B4 call note
mov bx, 100
mov ax, 659; E5 call note mov ax, 587; D5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 100
mov ax, 587; D5 call note mov ax, 659; E5
mov bx, 100 mov bx, 100
call note mov ax, 784; G5 call note
mov bx, 100
mov ax, 659; E5 call note mov ax, 740; F#5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 150
mov ax, 740; F#5 call note mov ax, 784; G5
mov bx, 100 mov bx, 200
call note mov ax, 740; F#5 call note
mov bx, 300
mov ax, 784; G5 call note mov ax, 988; B5
mov bx, 100 mov bx, 200
call note mov ax, 740; F#5 call note
mov bx, 300
mov ax, 784; G5 call note mov ax, 587; D5
mov bx, 400 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 784; G5;2ND call note mov ax, 659; E5
mov bx, 120 mov bx, 250
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 740; F#5 call note mov ax, 587; D5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 784; G5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 200
mov ax, 659; E5 call note mov ax, 784; G5
mov bx, 250 mov bx, 250
call note mov ax, 659; E5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 659; E5
mov bx, 150 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 494; B4 call note mov ax, 587; D5
mov bx, 150 mov bx, 100
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 494; B4 call note mov ax, 659; E5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 740; F#5
mov bx, 100 mov bx, 100
call note mov ax, 659; E5 call note
mov ax, 740; F#5 call note
mov ax, 784; G5 mov bx, 300
mov bx, 100 call note mov ax, 988; B5
call note mov bx, 200
mov ax, 740; F#5 call note
mov ax, 784; G5 mov bx, 300
mov bx, 400 call note mov ax, 587; D5
call note mov bx, 100
mov ax, 740; F#5 call note
mov bx, 80
mov ax, 784; G5;3RD call note mov ax, 659; E5
mov bx, 120 mov bx, 250
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 740; F#5 call note mov ax, 587; D5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 784; G5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 200
mov ax, 659; E5 call note mov ax, 784; G5
mov bx, 250 mov bx, 250
call note mov ax, 659; E5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 659; E5
mov bx, 150 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 494; B4 call note mov ax, 587; D5
mov bx, 150 mov bx, 100
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 494; B4 call note mov ax, 659; E5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 740; F#5
mov bx, 100 mov bx, 100
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 587; D5 call note mov ax, 784; G5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note
mov bx, 200 mov ax, 784
call note mov ax, 784; G5 mov bx, 400
mov bx, 250 call note
mov ax, 494; B4 call note
mov bx, 100 mov ax, 784; G5;4TH
call note mov ax, 784; G5 mov bx, 120
mov bx, 120 call note
mov ax, 494; B4 call note
mov bx, 100 mov ax, 740; F#5
call note mov ax, 587; D5 mov bx, 100
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 100 mov ax, 659; E5
call note mov ax, 659; E5 mov bx, 100
mov bx, 100 call note
mov ax, 784; G5 call note
mov bx, 100 mov ax, 659; E5
call note mov ax, 740; F#5 mov bx, 250
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 150 mov ax, 659; E5
call note mov ax, 784; G5 mov bx, 150
mov bx, 200 call note
mov bx, 80
mov ax, 494; B4 call note mov ax, 587; D5
mov bx, 150 mov bx, 100
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 494; B4 call note mov ax, 659; E5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 740; F#5
mov bx, 100 mov bx, 100
call note mov ax, 659; E5 call note
mov bx, 100
mov ax, 587; D5 call note mov ax, 784; G5
mov bx, 100 mov bx, 100
call note mov ax, 740; F#5 call note
mov bx, 80
mov ax, 659; E5 call note mov ax, 784
mov bx, 200 mov bx,400
call note mov ax, 784; G5 call note
mov bx, 250
mov ax, 494; B4 call note ;5TH
mov bx, 100 mov ax, 784; G5
call note mov ax, 784; G5 mov bx, 120
mov bx, 120 call note
mov ax, 494; B4 call note
mov bx, 100 mov ax, 740; F#5
call note mov ax, 587; D5 mov bx, 100
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 100 mov ax, 659; E5
call note mov ax, 659; E5 mov bx, 100
mov bx, 100 call note
mov ax, 784; G5 call note
mov bx, 100 mov ax, 659; E5
call note mov ax, 740; F#5 mov bx, 250
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 150 mov ax, 659; E5
call note mov ax, 784; G5 mov bx, 150
mov bx, 200 call note
mov ax, 740; F#5 call note
mov bx, 300 mov ax, 494; B4
call note mov ax, 988; B5 mov bx, 150
mov bx, 200 call note
mov ax, 740; F#5 call note
mov bx, 300 mov ax, 494; B4
call note mov ax, 587; D5 mov bx, 100
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 80 mov ax, 659; E5
call note mov ax, 659; E5 mov bx, 100
mov bx, 250 call note
mov ax, 659; E5 call note
mov bx, 100 mov ax, 587; D5
call note mov ax, 587; D5 mov bx, 100
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 80 mov ax, 659; E5
call note mov ax, 784; G5 mov bx, 200
mov bx, 100 call note
mov ax, 740; F#5 call note
mov bx, 200 mov ax, 494; B4
call note mov ax, 784; G5 mov bx, 100
mov bx, 250 call note
mov ax, 659; E5 call note
mov bx, 80 mov ax, 494; B4
call note mov ax, 659; E5 mov bx, 100
mov bx, 100 call note
mov ax, 740; F#5 call note
mov ax, 740; F#5 call note MOV CX,AX
mov bx, 100 MOV AL,0b6H
call note mov ax, 659; E5 OUT 43H,AL
mov bx, 100 MOV DX,0012H
mov ax, 784; G5 call note MOV AX,34DCH
mov bx, 100 DIV CX
call note mov ax, 740; F#5 OUT 42H,AL
mov bx, 100 JMP SHORT $+2
mov ax, 740; F#5 call note MOV AL,AH
mov bx, 150 OUT 42H,AL
call note mov ax, 784; G5 IN AL,61H
mov bx, 200 MOV AH,AL
mov ax, 740; F#5 call note OR AL,03H
mov bx, 300 OUT 61H,AL
call note mov ax, 988; B5 L1: MOV CX, 6000
mov bx, 200 L2: LOOP L2
mov ax, 740; F#5 call note DEC BX
mov bx, 300 JNZ L1
call note mov ax, 587; D5 MOV AL,AH
mov bx, 100 OUT 61H,AL
mov ax, 740; F#5 call note MOV BX, 65000
mov bx, 80 L3:LOOP L3
call note mov ax, 659; E5 POPA
mov bx, 250 RET
mov ax, 659; E5 call note NOTE ENDP
mov bx, 100 CSEG ENDS
call note mov ax, 587; D5 END MAIN
mov bx, 100
mov ax, 740; F#5 call note
mov bx, 80
call note mov ax, 784; G5
mov bx, 100
mov ax, 740; F#5 call note
mov bx, 200
call note mov ax, 784; G5
mov bx, 250
mov ax, 659; E5 call note
mov bx, 80
call note mov ax, 659; E5
mov bx, 100
mov ax, 740; F#5 call note
mov bx, 80
call note mov ax, 587; D5
mov bx, 100
mov ax, 659; E5 call note
mov bx, 100
call note mov ax, 659; E5
mov bx, 100
mov ax, 740; F#5 call note
mov bx, 80
call note mov ax, 740; F#5
mov bx, 100
mov ax, 659; E5 call note
mov bx, 100
call note mov ax, 784; G5
mov bx, 100
mov ax, 740; F#5 call note
mov bx, 80
call note mov ax, 784; G5
mov bx, 400
mov ax, 784; G5 call note
mov bx, 250
call note
MOV AH,4CH
mov ax, 784; G5 INT 21H
mov bx, 120 RET
call note
MAIN ENDP
mov ax, 587; D5 NOTE PROC
mov bx, 100 PUSHA

Вам также может понравиться