0% found this document useful (0 votes)
260 views

Lab 1

The document provides instructions for an assignment on programming the 8086 microprocessor in assembly language. It includes converting control structures like if/else statements and while loops from C to assembly language. It also describes how to write a procedure to read a character from the keyboard until a carriage return or 5 characters are entered. Finally, it asks students to write a program for a login system that reads a 5-character password from keyboard, compares it to a stored password, and prints "access granted" or "access denied".

Uploaded by

tesfu zewdu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
260 views

Lab 1

The document provides instructions for an assignment on programming the 8086 microprocessor in assembly language. It includes converting control structures like if/else statements and while loops from C to assembly language. It also describes how to write a procedure to read a character from the keyboard until a carriage return or 5 characters are entered. Finally, it asks students to write a program for a login system that reads a 5-character password from keyboard, compares it to a stored password, and prints "access granted" or "access denied".

Uploaded by

tesfu zewdu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Addis Ababa University

Addis Ababa Institute of Technology


School of Electrical & Computer Engineering

ECEG- 4501 Microcomputers & Interfacing

Lab1: Programming the 8086 in Assembly Language

1. Control Structures: Decisions

Convert the following C statements to assembly language, where x and y are variables.

if (x <= y)
x = x +1;
else
y = y 1;

2. Control Structures: Loops

Convert the following C statements to assembly language, where x and y are variables.

y =1;
while (x>0)
{
y=y*x;
x--;
}

3. Procedures

Write a procedure named read that reads a character from a keyboard until a carriage return is
entered or the number of characters entered so far is five. Use INT 21h / ah = 1 to read a character
from keyboard. You can define procedures as follows:

read PROC
;your code here
ret
read ENDP

4. Consider a login system. Suppose you have a 5-character password stored in DS in memory.
Write a program that reads a 5-char password string from the keyboard port; compare the
string with the password in memory; prints access granted if correct or access denied
otherwise. Use the procedure you wrote above to read password from keyboard.

Use INT 21h/ah = 9to display a string

1|Page

You might also like