You are on page 1of 4

HAWASSA UNIVERSITY

DEPARTMENT ELECTRICAL AND COMPUTER ENGINEERING

Part I
1. Explain how the performance of the computer is related to the following terms
a) Pipelining
b) Data bus
c) Address bus
d) RAM
2. List the features of 8086 microprocessor.
3. List the two functional unites of 8086 processor architecture and explain their purposes.
4. If CS = 35FBH and IP = 4578H, find the logical address, the physical address, the lower and
the upper range of the code segment.
5. If a data that needs to be fetched is in physical memory location 355A9H and SS = 3561H, does
the stack segment range include it or not? If not, what value should be assigned to SS if the BP
must be = 28D9H? (Show the result.)
6. Assume that the registers have the following values (all in hex) and that CS =1000, DS = 2000,
SS = 3000, ES=4000, IP=2110, SI = 50AF, DI = 60D0, BX = 6A80, BP = 7000, AX = 25FF,
CX = 8791, and DX = 1299.
Identify addressing mode in each of these instructions and if the instruction accesses the
memory, calculate the physical address of the memory where the operand is stored and the
contents of the memory locations.
MOV [1234H], AL
a)
MOV [BX], AX
b)
MOV [BP], DX
c)
MOV [IP], AH
d)
MOV ES: [SI], DX
e)
MOV AX, DX
f)
MOV DL,51
g)
MOV 50[BP][SI],AX
h)
7. Give the content of each conditional flags after execution of the following instruction.

MOV AX, 67A9H


MOV BX, 354AH
ADD AX, BX
CF=___, PF=______, AF=____, OF=_____, SF=______, ZF=______
8. Identify and explain the errors that are present in the following instructions:

a) MOV 23, AX_____________________________________________________________


b) MOV CX, CH_____________________________________________________________
c) MOVE AX, 1h____________________________________________________________
d) ADD 2, CX______________________________________________________________
e) PUSH AL________________________________________________________________
f) INC AX, 2_______________________________________________________________
g) MUL [DI] _______________________________________________________________
h) CMPSB [SI],[DI]__________________________________________________________
This study source was downloaded by 100000859731938 from CourseHero.com on 05-17-2023 09:21:33 GMT -05:00
1|Page
https://www.coursehero.com/file/156888395/Worksheetpdf/
9. What condition or conditions will terminate the repeated string instruction REPNE SCASB?

___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________

10. Write an instruction which transfer a 16 bit data from a CPU register to an input-output
port address of 6FD1H.
___________________________________________________________________________
__________________________________________________________________________
11. The initial registers content of 8086 is given below:
AX = 60F4 BX = 0000 CX = 0000 DX = 0000 SP = FFE6 BP = 0000 SI = 0000 DI = 0000
DS = 1207 ES = 1207 SS = 1207 CS = 0A0A IP = 0282
For the register content listed above, Show how the content of stack memory, registers (AX,
BX, CX and DX) and stack pointer (SP) is changing during the execution each of the
following six constitutive instructions. Please use a diagram to show the change of the content
of stack memory.
PUSH AX
PUSH BX
PUSH DX
POP CX
POP AX
POP DX

Part II
1. Complete the below 8086 assembly language instructions which copy 29 bytes of string data
from an area of memory addressed by Data_source into an area of memory addressed by Data_Dest.

.MODEL SMALL
.STACK 64
.DATA
Data_source DB “Microcomputer and Interfacing”
Data_Dest DB 29 DUP(?)
.CODE
; Start writing the code hereafter

2. Complete the below 8086 assembly language instructions which adds six decimal numbers
stored in X and store the sum result in Y.

.MODEL SMALL
.STACK 64
.DATA
X DB 125,145,234,100,128,179
Y DW ?
.CODE
; Start writing the code hereafter

This study source was downloaded by 100000859731938 from CourseHero.com on 05-17-2023 09:21:33 GMT -05:00
2|Page
https://www.coursehero.com/file/156888395/Worksheetpdf/
3. Write 8086 assembly language code to which do the following tasks:
Accepts an input form a keyboard
✓ If the input from the keyboard is ‘a’ it adds X and Y put the result in Z
✓ If the input from the keyboard is ‘b’ it subtracts X and Y put the result in Z
✓ If the input from the keyboard is ‘c’ it multiplies X and Y put the result in Z
✓ If the input is other than the above it displays “ERROR” messages

.MODEL SMALL
.STACK 64
.DATA
Message DB “ERROR”,’$’
X DB 125
Y DB 200
Z DW ?
.CODE
; Start writing the code hereafter

4. Prepare a program in Assembly for Intel 8086 that get two arrays of integers (A and B) from
the user. Each array has 10 elements (of 8 bits) and is able to: (10% Mark)
a) Compute all possible sum among 10 values of first array and 10 values of second array, putting
results in a matrix of 10x10 values (of words size).
SUM[i][j]=A[i]+B[i]
b) Compute all possible products among 10 values of first array and 10 values of second array,
putting results in a matrix of 10x10 values (of words size).
PRODUCT [i][j]=A[i]*B[j]
c) Find the maximum value both for the first (A) and the second (B) array.
d) Find the maximum value among values of the so computed matrix (SUM and PRODUCT).

5. Prepare a program in Assembly for Intel 8086 able to get inputs as a brief text of three rows,
each of them with a maximum of 40 characters. The program has to perform following
computations on the text, as follows:
a) Write the Assembly code required to get text by means of calls to INT 21H; at the end
of the acquisition phase text has to be in the arrays:
FIRST_ROW DB 40(?)
SECOND_ROW DB 40(?)
THIRD_ROW DB 40(?)
b) For each row it is required to count the number of times each character appears (desired
characters are only a..z, A...Z), printing, for each row, the character that appears more
times. If more than one character appears for the same number of times, it is possible to
choose freely one of them
c) Print the character that appears more times given all the three rows together. Please note
that this character can be different from the characters found in point.
This study source was downloaded by 100000859731938 from CourseHero.com on 05-17-2023 09:21:33 GMT -05:00
3|Page
https://www.coursehero.com/file/156888395/Worksheetpdf/
d) Finally, print the text using a Caesar cipher, applied only to a..z and A..Z characters of
each row. Every other character has to be simply copied. Parameter k has to be defined
as a constant in the program, and has to be the same for all the three rows of text. A
Caesar cipher transforms letter a in a+k, given this succession of characters:
a..zA...Za...zA..Za...z, etc.. As example, with k=3, maZzo is transformed in pdcCr.

6. Prepare a program in Assembly for Intel 8086 able to get date as an input from a keyboard and
as an output the number of days from the 1st January 2000 up to the date in input will be
displayed in the monitor. The date is in a Gregorian calendar. The user input the data in
“dd/mm/yyyy” format.
Example: Given string “12/05/2005” return value is 1868.

7. Write 8086 assembly language code which take a single character for a keyboard,

✓ if the character is capital letter it displays “The Character is Capital Letter”


✓ if the character is Small letter it displays “The Character is Small Letter”
✓ if the character is Number letter it displays “The Character is Number”
✓ if the character is neither of the above it displays “The Character is neither alphabet
nor number”

(Hint: The ASCII code for numerals is from 30h to 39h. The ASCII code for capital letters is from 41h
to 5Ah. And for small letter is from 61h to &7A.) (14 Points)

8. Write a program in 80x86 assembly language that reads one character at a time from the
keyboard. Those characters that are vowels (a,e,i,o and u ) (and only those characters) are stored
in a buffer. This buffer should be 10 bytes long. Vowels entered after the buffer is full should
be discarded. The program should stop reading characters when a ’$’ is entered.
After the’$’ character is entered, the program should output a carriage return and line
feed, followed by the contents of the buffer, converted upper case, with a space character
between each vowel, and a final carriage return and line feed.
Your program should make use of at least four functions defined by you that do the
following: (1) read a character, (2) print a character, (3) determine if a character is a
vowel, (4) convert a character to upper-case.
For example, if the input is:
John Brown (12345678). The lAzY brown fOx jumps on the qUick dog’s back$
Then your program should print:
OOEAYOOUOE

This study source was downloaded by 100000859731938 from CourseHero.com on 05-17-2023 09:21:33 GMT -05:00
4|Page
https://www.coursehero.com/file/156888395/Worksheetpdf/
Powered by TCPDF (www.tcpdf.org)

You might also like