Test Exercise Solution Cte 221
Test Exercise Solution Cte 221
SOLUTION 10 marks
.mode1 small
.stack 100h
.data tot db “HelloWorld$”
.code
Start:
Mov ax, @data
Mov ds, ax
Mov ah, 09h
Mov dx, offset tot
Int 21h
Mov ah, 4ch
Int 21h
End start.
2. Itemize five (5) functions of Addressing mode in the 8086 microprocessor
SOLUTION
i. To access large address space
ii. To specify address with smaller number of bit
iii. For easy implementation of common data structure e.g Array, stack, linkers
iv. To achieve fast and less complex computation
v. To enhance easy implementation of software features. 2 marks each
3. Highlight any eight (8) General purpose Register for x86 microprocessor.
SOLUTION:
1. – AX – Accumulator register
2. – Bx – Base register
3. – Cx – Counter register
4. – Dx – Data Register or general ledger register
5. – Si – Source index pointer
6. – Di – destination index pointer
7. – bp – base pointer register
8. -sp – stack pointer register
SOLUTION
SOLUTION:
In low level language, programmers use English-like abbreviations to represent
elementary operations. Instructions are coded using mnemonics:
E.g. DIV, ADD, SUB, MOV.
Assembly language is an example of a low level language.
Solution
⇒ 10 1110.0110 1
The first group is having only 2 bits. So, include two zeros on extreme side
in order to make it as group of 4 bits.
Include three zeros on extreme side in order to make the last group also as
group of 4 bits.
⇒1 1101.1110 11
⇒1 D . E C
=1D.EC16
Solution:
Separate the binary numbers into groups of 3 bits on both sides of binary
point.
⇒101 110.011 01
The last group is having only 2 bits. So, include one zero on extreme side
in order to make it as group of 3 bits.
⇒ 101110.0110102
= 56.328
Separate the binary numbers into groups of 3 bits on both sides of binary
point.
The last group is having only 2 bits. So, include one zero on extreme side in
order to make it as group of 3 bits.
=3 7. 5 4
⇒ 011111.1011002
= 37.548
SOLUTION
⇒53210
⇒ 5 3 2
SOLUTION
⇒26710
⇒2 6 7
SOLUTION
Therefore, -17
= 110001
= 00110001
but the sign bit has to come first before the padded zeros
SOLUTION
⇒The binary equivalent 28
= 11100
Therefore, -28
= 111100
=00111100
⇒but the sign bit has to come first before the padded zeros
17. Using a 5-bit machine add -9 and +4 and find its 2’s complement.
SOLUTION
10111
+ 00100
11011
= 10100
10100
+ 1
10101
This is equivalent to -5
______________