You are on page 1of 6

FINAL EXAM Date

Semester/Academic year 2 2021-2022


19/5/2022
Course title Computer System Engineering
UNIVERSITY OF TECHNOLOGY - VNUHCM Course ID EE3401
FACULTY OF EEE Duration 90 mins. Question sheet code
Student name: ID:

Notes: - Students can use one A4 paper with two sides for your references.
- Students submit the question sheets together with the answer sheets

Problem 1: (L.O.1 & L.O.2) (20pts) Answer the following questions

1. (5pts) x86-8086 processors have:


 Max CPU clock: 10 MHz True False .
 16-bit wide data bus True False .
 8-bit register True False .
 The architecture of 8086 has only one major unit: BIU and EU True False .
 The maximum linear address space is limited to 64 KB True False .

2. (5pts) ARM processors have:


 16-bit CPU True False .
 Harvard architecture True False .
 Only have 3-operand instructions True False .
 Halfword means 14 bits True False .
 Seven operating modes True False .

3. (5pts) Given the picture show how a device with the interrupt vector can be connected on an
8088 microprocessor system ?

------------------------------------------------------------------------------------------------------------------------------------------
Write student’s name and ID into your exam paper Page 1
What is the interrupt vector?

4. (5pts) How many modes of operation does Intel processor run? List them.

Problem 2: (L.O.5) (10pts) Answer the value of registers after the instruction is executed.

No. Before Instruction After


1 AX: B5 26 mov AL, BH AX:
BX: 9F E8 BX:
2 EAX: 35 F7 60 ED xor EAX, EBX EAX:
EBX: 22 B3 AE 20 EBX:
3 EAX: 00 00 D3 20 imul EAX, Double EAX:
Double: 00 00 15 4D CF: OF:
4 EAX: 00 00 E7 25 sub EAX, 59175 EAX:
SF: ZF: CF: OF:
5 ECX: D4 D6 66 4F sar ECX, 4 ECX:
SF: ZF:

Problem 3: (L.O.5) (10pts) Write x86 Assembly language code for the following pseudo code:
Pseudo Code ASM code

if (AX ≥ BX) then {


AX = AX + BX
BX = AX / 2 }
else {
AX = AX - BX
BX = BX / 4
}

------------------------------------------------------------------------------------------------------------------------------------------
Write student’s name and ID into your exam paper Page 2
Problem 4: (L.O.5) (10pts) Write an 80x86 assembly language program to compute:

F = 21*t3 + 45*t2 + 10*t

Assume that:

 t is stored in register EAX


 F is stored in register EBX

ASM procedure

Calc:

Problem 5: (L.O.5) (10pts) Given a function as below:

int is_Even(int n)
{
if (n < 0)
return -1;
else if (n&0x01)
return 0;
else
return 1;
}
Rewrite this function in Assembly language (assume that n is stored in EBX, the return value is stored in
EAX):

is_Even:

------------------------------------------------------------------------------------------------------------------------------------------
Write student’s name and ID into your exam paper Page 3
Problem 6: (L.O.3) (10pts) Given the data segment DS = 0x7720.
The instruction “mov [0xDCEF], EAX” will store the content of EAX in which 20-bit address?

Segment address =
Offset address =
20-bit address =

Problem 7: (L.O.2) (10pts) Write a sequence of instructions that initialize vector 45H to point to the ISR
“isr45”.

------------------------------------------------------------------------------------------------------------------------------------------
Write student’s name and ID into your exam paper Page 4
Problem 8: (L.O.5) (10pts) Explain the uses of virtual memory.

Problem 9: (L.O.5) (10pts) What are memory problems with the following C codes? How to
solve the problems?

No. C codes What are problems? How to solve the problems?


1 int *my_code =
malloc(20* sizeof(char));
int i = 0;
while (i < 20) {
my_code[i] = i++-;
}

2 class student {};


student **s = new
student*[100];
for (int i=0;i<100;i++)
s[i] = new student[20];

// After using s
------------------------------------------------------------------------------------------------------------------------------------------
Write student’s name and ID into your exam paper Page 5
delete[] s;

------------------------------------ END ------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------
Write student’s name and ID into your exam paper Page 6

You might also like