Professional Documents
Culture Documents
lab reportبوشوفه
lab reportبوشوفه
Lab report
ID:022171912
Supervisor:ابوبكر ابوشوفة.د
Date:13/7/2022
Spring 2022
1. Objectives:
To be able to control the computer screen
To learn how to process data arrays
2. Introduction:
Microprocessors are typically programmed using semi-English-language statements (assembly
language). In addition to assembly languages microprocessors use a more understandable
human-oriented language called high-level language .no matter what type of language is used to
write programs, microprocessors understand only binary numbers therefore all programs must be
translated into their appropriate binary forms.
Microprocessor programming language can typically be divided into three types: machine
language, assembly language, high-level language. A machine language program consists of
either binary or hexadecimal op-codes programming a microprocessor with either one are
relatively difficult, because one must deal only with numbers.
In this experiment we are using Microsoft DEBUG which is supplied as a part of MSDOS
package to write assembly language programs to perform different kind of tasks.IN order to
avoid conflict with other programs, we’re using memory locations between 200H and 2FFH for
writing programs ,and locations 340H to 4FFh to store data.
3. Experiment Procedure :
Part 1:
A. Procedure-1(clearing video display):
Determine the current mode with service 15 of interrupt 10H.the mode number ends up in
register AL.
To move the cursor we use service 2 of interrupt 10 . The row number must be in register DH,
and the column number in DL, and register BH must be zero.
We insert 35 which ASCII for % at location 400H and then run the program
After running the program the result is shown in the figure below
Exercises:
1. Make the program write a character in the bottom, right hand corner of the display
2. Write a program that puts the number 88 near the center of the display. Note that INT
10 changes Ah but not AL.
3. Write a program that takes two hexadecimal digits from locations 400 and 401 and
display them near the center of the screen. Run it with [400]=0B and [401]=0E.
Part 2 :
A. Procedure-1 (sum of Data):
We execute the program using the G=200 command, then examine the location 400H
Here an overflow happens because the sum of the numbers now is bigger (13B) and need more
than one byte to be stored ,so only the lower bits of the result are stored in location 400.
B. Procedure-2(Using a terminator):
When we are not sure how long an array is ,we can follow the data with a special marker or
terminator. It must have a value that cannot be a real data item.in a summation zero is a good
choice because it doesn’t affect the sum.
We execute the program using the G=200 command and the result are shown in the figure
below.
4. Conclusion:
In this experiment we used Microsoft debug to write programs in assembly language to perform
a number of tasks like clearing the screen, changing the cursor position, displaying a character on
the screen, as well as dealing with data arrays where we looped through an array and saved the
sum of its contents in the memory, and for the case when we don’t know how long our data is we
used a terminator to indicate the end of summing function.