Midterm Tutorial 3
Midterm Tutorial 3
Midterm Tutorial 3
Time : 2 hours
2.
3.
An address field in an instruction contains decimal value 14. Where is the corresponding operand
located if indirect addressing mode is used?
4.
5.
Name the pairs of registers used to hold the base and offset address of stack operation in .386?
6.
7.
In real-mode, how many bits can be used in Flags register for any instructions?
8.
What is the signal name generated by processor as a respond of an interrupt request signal sending
by I/O module?
9.
10.
11.
12.
13.
14.
15.
16.
If the address bus is 8 bit and data bus is 16 bit what are the maximum addressable memory and size
of data that can be used?
17.
What are the pairs of registers in 80386 microprocessors used to hold the address of instructions in
memory?
18.
19.
Give one (1) advantage of Indirect addressing mode compare with Direct addressing mode?
20.
If the address bus is 16 bits and data bus is 32 bits what are the maximum addressable memory and
size of data that can be used?
1 Address
LOAD M
STORE M
ADD M
SUB M
MUL M
DIV M
Table 1
2 Address
MOVE (X Y)
ADD (X X + Y)
SUB ( X X - Y)
MUL (X X x Y)
DIV (X X/Y)
3 Address
MOVE (X Y)
ADD (X Y + Z)
SUB (X Y-Z)
MUL (X Y x Z)
DIV (X Y/Z)
(10 marks)
a) Given that DS = F000H, BX = C300H, DI = 00A3H and LIST = 0100H, determine the physical
memory address accessed by each of the following instructions assuming real-mode operations and
briefly describe the operation that each instructions will performed.
i.
iii.
(8 marks)
b) Figure 1 shows the assembly language vote.asm program for identifying the voters eligibility based on
age user input data with 28 lines of instruction. By evaluating the program, answer the following
questions:
i.
What is the size of the reserved stack memory used in the program?
(2 marks)
ii.
Identify four (4) errors in the program and justify your answer by rewriting the right coding
(4 marks)
iii.
Construct and explain the flowchart of the program
(4 marks)
iv.
Modify and construct flowchart of the program that enable the user to enter their name and
age and display both at the end with the result of their eligibility to vote
(12 marks)
Line#
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.model medium
.stack 100h
.data
Prompt
db
13,10, Please enter your age (0 to 99)
Age
db
3,4 dup ()
Yes1
db
13,10, Congratulation, you are eligible to vote
No1
db
Sorry, you are under age
.code
START:
mov
ax, seg Prompt
mov
ds, ax
mov
ah, 9
mov
dx, offset Prompt
int
21h
mov
ah, 0ah
mov
dx, offset age
int
21h
mov
ax, offset age
mov
bh, [ax+2]
mov
bl, [ax+3]
cmp
ax, 21
jae
yes
mov
dx, offset No1
jmp
dispmessage
yes:
mov
dx, offset Yes1
dispmessage: mov
ah,9
int
21h
mov
ah, 4c00h
end start