Міністерство
освіти України
Кіровоградський
Державний Технічний Університет
Факультет
автоматики, енергетики та програмування
Курсова
робота
на
тему: “Screen Saver”
Зміст
Завдання на курсову роботу
Вступ
1. Призначення та область
використання програми
2. Технічні характеристики
2.1 Постановка задачі на розробку
програми
2.2 Опис алгоритму та функціонування
програми
2.3 Опис язика програмування
2.4 Опис складу технічних і
програмних засобів
3. Текст програми
Висновок
Перелік літератури
Завдання на курсову роботу
На мові
програмування ASM 86 розробити резидентну програму на тему ”Screen saver”
(зберігач екрану), яка гасить екран у разі тривалої перерви в роботі з
комп’ютером. Текстову документацію до програми оформити у вигляді пояснювальної
записки за вимогами ДГСТ 2.105–79, ДГСТ 2.106–68, ДГСТ 2.104–68 та ДГСТ
7.32–81.
Вступ
Курсова робота з
дисципліни “Програмування на ASM 86” на тему “Screen saver” складається з
програмної частини (файл ssaver) та документації (пояснювальна
записка).
1.
Призначення та область використання програми
Файл ssaver
є резидентною програмою, яка має призначення гасити екран при тривалій перерві
в роботі з комп’ютером. Якщо на протязі хвилини на клавіатурі не була натиснена
жодна клавіша, то екран погасне. Для того, щоб відновити зображення достатньо
просто натиснути на будь-яку клавішу.
Ця програма є
дуже корисною, бо оберігає екран від передчасної втрати чіткості та
кольоровості зображення, та має широку область застосування, особливо на
персональних ЕОМ.
2.
Технічні характеристики
2.1
Постановка задачі на розробку програми
На мові
програмування ASM 86 розробити резидентну програму, яка здійснює гасіння екрану
через заданий проміжок часу, якщо жодна клавіша не була натиснена.
2.2
Опис алгоритму та функціонування програми
Процедура OLD_09H
отримує вектор переривання 09H, зберігає його в змінній OLD_KB та встановлює
новий обробник переривання – NEW_09H.
Процедура обробки
переривання NEW_09H викликається по натисканню будь-якої клавіші. Так як в процесі її
виконання використовуються регістри, на самому початку процедури усі регістри
зберігаються в стек. Потім обнуляється лічильник часу COUNTER. Після цього
перевіряється чи був погашен екран. Це робиться шляхом перевірки змінної MODE.
Якщо MODE=1 (екран погашен), то здійснюється перехід на мітку SS_OFF, де вміст
масиву VIDEO0 – збережена раніше відео пам’ять – заноситься назад в відео
пам’ять, режим екрану MODE встановлюється в 0 (екран не погашен), і обробник
закінчує свою роботу, розблокувавши перед цим контролер переривань та контролер
клавіатури, а також відновивши значення всіх регістрів з стеку.
Якщо ж MODE=0
(екран не погешен), то з стеку відновлюються значення усіх регістрів та
керування передається старому обробнику переривання.
Процедура OLD_1CH
працює аналогічно процедурі OLD_09H. Вона також отримує вектор переривання 1CH,
записує його в змінну OLD_TIMER та встановлює новий обробник переривання –
NEW_1CH.
Процедура обробки
переривання NEW_1CH викликається приблизно 18.2 рази в секунду. Аналогічно
процедурі NEW_09H, NEW_1CH також змінює значення регістрів, і для коректної
роботи їх потрібно зберегти в стек, що й робиться на самому початку процедури.
Далі перевіряється змінна MODE, щоб запобігти багаторазовому гасінню екрану.
Якщо MODE=1 (екран був погашен), то здійснюється перехід на мітку EXIT, де
відновлюються з стеку значення регістрів та керування передається старому
обробнику переривання.
Якщо MODE=0
(екран не погашен), то перевіряється чи досяг лічильник часу COUNTER
необхідного значення. Якщо не досяг, то значення COUNTER просто збільшується на
одиницю і, відновивши з стеку значення усіх регістрів, керування передається
старому обробнику. Якщо ж лічильник COUNTER досяг заданого значення, то
здійснюється перехід на мітку SS_ON, де вміст відео пам’яті зберігається в
масив VIDEO0, а в відео пам’ять переписуються нулі із масиву VIDEO1. Після
цього змінна MODE встановлюється в 1 (екран погашен), з стеку відновлюються
значення регістрів та керування передається старому обробнику переривання.
2.3
Опис язика програмування
ASM 86 являє собою мову програмування низького рівня. Основною різницею язика Assembler від язиків високого рівня
таких як C, Pascal та інші, є те, що оператори язиків високого рівня звичайно
переводяться в цілі набори машинних кодів, а команди язика Assembler
безпосередньо в машинний код. Язик Assembler має багато достоїнств і одним з
них є те, що на Assemblerі можна на пряму користуватися командами процесора.
Мова ASM 86 дозволяє оперувати такими символами:
–
латинські
літери: 26 заглавних та 26 строкових літер;
–
цифри:
від 0 до 9;
–
знаки
арифметичних операцій:
1.
+ (додавання)
2.
- (віднімання)
3.
*
(множення)
4.
/ (ділення)
5.
=
(еквівалентно);
-
команди
пересилки даних, (MOV, LEA, XCHG, PUSH, POP),
-
команди
арифметичних операцій, (ADD, ADC, SUB, SBB, MUL, IMUL, DIV, IDIV),
-
команди
логічних операцій, (NOT, AND,OR, XOR),
-
команди
передачі керування, (JMP, JA, JNA, JB, JNB, JE, JNE, JZ, JNZ, JC, JNC, INT, IRET, CALL, RET)
-
спеціальні
команди, (OFFSET – зміщення, MODEL – модель пам’яті, CMP – порівняння).
Також ASM 86 дозволяє
оперувати з регістрами мікропроцесору (AX, BX, CX, DX, DI, SI, CS, DS, ES, SS,
BP, SP), з пам’яттю та відео пам’яттю.
2.4
Опис складу технічних і програмних засобів
Гарантується
коректна робота програми при наявності слідуючого складу технічних та програмних засобів:
–
мікропроцесор................................................. Intel 80286 або
вище;
– об’єм
оперативної пам’яті............................... 640kb та більше;
– об’єм
вінчестера............................................... 40Mb або більше;
– операційна
система........................................... MS DOS.
Програма
складається з одного виконавчого файлу ssaver. Для того, щоб
запустити програму на виконання необхідно просто набрати її ім’я в командному
рядку DOS , вказавши перед ним шлях до файлу.
Наприклад C:ssaverssaver
Висновок
Завдяки виконаній
роботі, був детально розглянуто та реалізовано алгоритм роботи резистентної
програми, керування процесом обробки даних отриманих від портів на яких
знаходиться пристрій виводу на екран. Була створена програма, яка гасить екран,
якщо не була натиснена жодна клавіша.
Перелік
літератури
1.
Том Сван
“Освоение Turbo Assembler” (Второе издание) Диалектика 1996г.
2.
Д. Бредли “Программирование
на языке Ассемблер для IBM PC”
3.
П. Нортон “Программно
аппаратная организация компьютера IBM PC”
4.
Ю.С. Лукача
“Программно - технические средства персональных ЭВМ семейства IBM PC”.
5.
В.Н. Пильщиков
“Программирование на языке ассемблер”-“Диалог-Мифи” Москва 1997.
Текст програми
.MODEL TINY
.CODE
ORG 100H
START:
JMP INIT
OLD_KB DW 0,0
OLD_TIMER DW
0,0MODE DB 0
COUNTER DB 0
VIDEO0 DB 4000
DUP (?)
VIDEO1 DB 4000
DUP (0)
OLD_09H PROC
MOV AH,35H
MOV AL,09H
INT 21H
MOV
CS:OLD_KB,BX
MOV
CS:OLD_KB+2,ES
MOV AH,25H
MOV AL,09H
LEA DX,NEW_09H
INT 21H
RET
OLD_09H ENDP
NEW_09H PROC
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
PUSH SI
PUSH DS
PUSH ES
MOV
CS:COUNTER,0
CMP CS:MODE,1
JE SS_OFF
POP ES
POP DS
POP SI
POP DI
POP DX
POP CX
POP BX
POP AX
JMP DWORD PTR
CS:OLD_KB
SS_OFF:
MOV AX,0B800H
MOV ES,AX
MOV DI,0
PUSH CS
POP DS
MOV SI,OFFSET
VIDEO0
MOV CX,4000
CLD
REP MOVSB
MOV CS:MODE,0
MOV AL,20H
OUT 20H,AL
IN AL,61H
MOV AH,AL
OR AL,128
OUT 61H,AL
MOV AL,AH
OUT 61H,AL
POP ES
POP DS
POP SI
POP DI
POP DX
POP CX
POP BX
POP AX
IRET
NEW_09H ENDP
OLD_1CH PROC
MOV AH,35H
MOV AL,1CH
INT 21H
MOV
CS:OLD_TIMER,BX
MOV
CS:OLD_TIMER+2,ES
MOV AH,25H
MOV AL,1CH
LEA DX,NEW_1CH
RET
OLD_1CH ENDP
NEW_1CH PROC
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
PUSH SI
PUSH DS
PUSH ES
CMP CS:MODE,1
JE EXIT
CMP
CS:COUNTER,0444H
JE SS_ON
INC CS:COUNTER
EXIT:
POP ES
POP DS
POP SI
POP DI
POP DX
POP CX
POP BX
POP AX
JMP DWORD PTR
CS:OLD_TIMER
SS_ON:
PUSH CS
POP ES
MOV DI,OFFSET
VIDEO0
MOV AX,0B800H
MOV DS,AX
MOV SI,0
MOV CX,4000
REP MOVSB
MOV AX,0B800H
MOV ES,AX
MOV DI,0
PUSH CS
POP DS
MOV SI,OFFSET
VIDEO1
MOV CX,4000
CLD
REP MOVSB
MOV CS:MODE,1
JMP EXIT
NEW_1CH ENDP
INIT:
MAIN PROC
CALL OLD_09H
CALL OLD_1CH
LEA DX,INIT
INT 27H
MAIN ENDP
END START
Другие работы по теме:
Initiation Into American Culture Essay Research Paper
Initiation into American Culture: The Hollywood Smoke Screen As a foreigner looking inward through a glass window, the foundation of the American culture appears to be based on the idealism of life, liberty and the pursuit of happiness. Each year thousands migrate into the United States in search of freedom, democracy and the distinguished American Dream.
Walden Essay Research Paper Manns 1Ken MannsMike
Walden Essay, Research Paper Manns 1 Ken Manns Mike Sanders English 10002 15 February 2001 “To Be Awake is to Be Alive” Why do so few Americans not see all of the problems in society? Do they simply not care or are they not able to see them? With Thoreau’s statement, “To be awake is to be alive”, he implies that Americans have their eyes closed to these issues.
Final Exam Essay Research Paper Beginning Windows
Final Exam Essay, Research Paper Beginning Windows ?98 Instructor: Zita Podany Final Exam 1. To format a high-density diskette to use on my PC, I would first click on ?My Computer?, (which is located on the desktop) and insert your diskette, then right click on ?3? floppy?. Go to format, then make sure ?Quick? or ?Full? are checked, then click on the ?start? button.
Quality Vs Old Fasion Essay Research Paper
Quality vs. Old Fashion With the introduction of DVD technology, VHS videotapes are eventually going to be put out of production. Just like compact disks have taken over cassette tapes. Although cassette tapes are still being produced, they are not as popular as they were during the late 70’s and early 80’s.
Star Wars Film Codes Essay Research Paper
The film Star Wars by George Lucas presents the characters Luke Skywalker, Darth Vadar and Princess Leia in particular ways. This essay will give examples of the different film codes, such as audio, technical and symbolic that help the viewer to see the characters in each of these ways. The Alliance The character of Luke Skywalker becomes more real from the use of film codes.
You Might Be A Nerd Essay Research
Paper You Might Be a Computer Nerd if… written by Nosferatu ? Your web page is more popular than you. ? Your favorite sport is Tetris. ? You know what fuzzy logic is.
Internet Search Essay Research Paper I recently
Internet Search Essay, Research Paper I recently took a workshop on how to use the Internet. I thought that writing an essay on ?how to use the Internet? would help me to remember what I learned
WAR And PEACE And How It Effected
The World Essay, Research Paper If your computer starts up in the 24 bit version of the game with fuzzy looking graphics, try re-selecting the screen mode from the F11 menu. This
Computer Aided Drafting And Design Essay Research
Paper Computer Aided Drafting and Design CADD stands for Computer Aided Drafting and Design. By using the computer for the functions normally utilized by hand, a greater amount of efficiency can be attained. By drawing lines with a computer on a screen, corrections can be made without erasing the entire product.
How Television Works Essay Research Paper How
How Television Works Essay, Research Paper How Television Works. There have been countless inventions that have forever changed the world just by their existence. Many of these have been related to communications, such as a radio, phone, and more specifically the television. Soon after it’s release, millions of families across the nation had their own television set, adding something new and exciting to the list of American pastimes.
Personal Computers And Laptop Computers Essay Research
Paper The two types of computers that are the most common people use are the Personal computer, and the Laptop computer. Most people would say that there is not that much difference between the two, but they have no idea how wrong they are.
Oedipus Paper Essay Research Paper One of
Oedipus Paper Essay, Research Paper One of Oedipus greatest qualities as a leader was his ability to solve problems. The reason that Oedipus, not even a native of Thebes, became the king of that land was due to the great intelligence and strength shown in his defeat of the Sphinx. He was able to save the Thebans from that problem, so when the city again needs help, Oedipus is very willing to show his strength again.
How To Make A Pizza Essay Research
Paper How To Make A Pizza I understand that you are one of our new employees and I am suppose to teach you how we make our pizza. The first thing that you do is take one of our screens from the shelf and a dough ball
Lacquer Screen Essay Essay Research Paper Confucianism
Lacquer Screen Essay Essay, Research Paper Confucianism was one of the most influential of the four Great Traditions in ancient China. However, it did not become such a big way of life until after Confucius death, as he only had a small number of disciples following him during his lifetime. Confucianism stressed the importance of some of the greatest virtues of life, including filial piety, Jen, Chi, Yung, and Li, as these represented devotion to the parents, benevolence, wisdom, moral courage, and ritual, and were the keys to achieving moral goodness.
Violent World Essay Research Paper Let
Violent World Essay, Research Paper Let’s face it, we live in a violent world. We can see it in many aspects of our surroundings, and if we miss it we have a chance to see it played out again and again in the media. There have been countless books and studies on violence in our society and on how to prevent it and what it all means; there will, no doubt, be countless more.
Rich Essay Research Paper Imaginative TransformationAdrienne Rich
Rich Essay, Research Paper Imaginative Transformation Adrienne Rich writes, For a poem to coalesce, for a character or an action to take shape, there has to be an imaginative transformation of reality which is no way passive (610). Imaginative transformation means to be able to look at something from different perspectives, what might seem black to one might be white to the another.
Hybrid Printing Process Essay Research Paper INTRODUCTIONThe
Hybrid Printing Process Essay, Research Paper INTRODUCTION The printing for hybrid circuits is a fundamental process in which the conductors, resistors and overglaze are put onto a ceramic tile called a substrate. While conductors, resistors and overglaze are not printed at the same time, the process is the same.
Television Essay Research Paper We have at
Television Essay, Research Paper We have at least a television in our home. television allows us to hear and see events as soon as they happen. If our grandma’s mother or father see TV, they’ll
The Computer Mouse Essay Research Paper The
The Computer Mouse Essay, Research Paper The Computer Mouse The computer mouse is a common pointing device, popularized by its inclusion as standard equipment with the Apple Macintosh. With the rise in
Writing For The Screen Essay Research Paper
Writing for the Screen I was sitting down one day watching a movie in the theater and I had noticed how insignificant and how bland it was. There really didn’t seem to be much essence, not much feeling of intense emotions in it that really needed to be applied to the subject matter. I felt very inspired to act upon this and correct it.
Potatoes Essay Research Paper May 13 2001All
Potatoes Essay, Research Paper May 13, 2001 All the Pictures Potatoes. Instant potatoes at that. This was the meal of the evening. A plastic bowl half filled with a pasty hot goo that claimed to be somehow derived from a potato. Thoughtlessly, Jimmy gulped it down as he stared blankly at his computer screen.
Lcd Monitor Essay Research Paper LCD MONITORLiquid
Lcd Monitor Essay, Research Paper LCD MONITOR Liquid Crystal Display (LCD) stands for Liquid Crystal Display. Liquid crystals are transparent substances exhibiting both sold and liquid matter properties. Light passing through liquid crystal follows the alignment of the molecules that make them up.
Childhood Essay Research Paper We were then
Childhood Essay, Research Paper We were then Children with nothing but Childhood. We played kiss Tag and suicide which Was merely a game with Throwing, and running, and Touching the side of the
What Is Hdtv Essay Research Paper What
What Is Hdtv Essay, Research Paper What is HDTV? HDTV, the first completely new TV standard since the introduction of the medium in the 40’s, allows a picture with much finer visual detail and better color than the NTSC standards used with today’s analog TV sets. Pictures can have 3 to 5 times the sharpness of today’s broadcasts and no noise or snow.
Violence On Screen Essay Research Paper In
Violence On Screen Essay, Research Paper In the last few years, I have noticed that on screen violence has become as common as a Cheesesteak in Philadelphia. People often argue that the violence
Pr In A Nutshell For Soapy Saver
Essay, Research Paper Mission Statement for PR: Through the functional use of marketing and management, PR will effectively deal with public issues encountered by a firm across its wide range of constituents.
Xxx Essay Research Paper POST PAPER and
Xxx Essay, Research Paper POST PAPER and get PasswordIf you submit a paper, it will be immediately posted to the site and searchable within seconds. This alsowill give you immediate access to the Free Search engine with over 1,000 papers. Since most of you arelazy, we already knew that most of you will try to get past this screen without submitting a paper.