You are on page 1of 10

University of Tripoli- Faculty of engineering

Department of electrical and electronics

EE561 Control and computer lab II

Advanced Microprocessor programming

Lab report

Name:‫هديل عادل عبيد‬

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.

Set the mode (From AL) with service 0 of interrupt 10H.

After running the program the result is shown if figure below


B. Procedure-2 (moving the cursor):

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.

The result of running the program is shown in figure below


C. Procedure-3 (writing a character):

We use service 14 of interrupt 10H.AL must contain the ASCII data.

We insert 35 which ASCII for % at location 400H and then run the program

The result is shown in figure below


We can separate DEBUG’S message from the program’s output by moving the cursor. To do that
we add the following instructions after the last INT 10.

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 use the A command to write the program starting at location 200H.

We insert the data starting from location 420H as follows.

We execute the program using the G=200 command, then examine the location 400H

We change 422 to F1 and run the program again

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.

We repeat the above steps using six elements.


We change the contents of CX to 6 and then run the program.

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 use the command A to write the program

We insert the data starting at location 420H.

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.

You might also like