BSD1308  ASSEMBLY PROGRAMMING.

UNIVERSITY EXAMINATIONS: 2018/2019
EXAMINATION FOR DEGREE OF BACHELOR OF SCIENCE IN SOFTWARE
DEVELOPMENT
BSD 1308: ASSEMBLY PROGRAMMING
MODE: FULL TIME/PART TIME/DISTANCE LEARNING
ORDINARY EXAMINATIONS
DATE: AUGUST.2019 DURATION: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO questions

QUESTION ONE [30 MARKS]
a) Explain two advantages and two advantages of assembly language.
4 Marks
b) Describe the following concepts as used in assembly language programming.
i. Mnemonic
ii. Opcode
iii. Operands
3 Marks
c) List and explain any THREE control/status registers.
3 Marks
d) List and explain any TWO user-visible registers.
2 Marks
e) Describe the following types of assembly languages.
i. CISC Assembly language
ii. RISC Assembly language
4 Marks
f) Differentiate between one-pass and two-pass assemblers.
4 Marks
g) Describe any THREE functions of an assembler.
6 Marks
h) For each of the following assembly statements, state and explain the address modes used.
i. MOV ECX,[EBX+EDI+20]
ii. MOV EAX,406
4 Marks
QUESTION TWO [20 MARKS]
a) State and explain THREE keywords used in assembly language
3 Marks
b) Differentiate between numeric and symbolic labels in assembly language.
4 Marks
c) Differentiate between integer constants and integer expressions in assembly language.
2 Marks
d) Briefly explain the format of an assembly language program.
5 Marks
e) Brief state and explain any THREE assembly language directives
6 Marks
QUESTION THREE [20 MARKS]
a) Write a simple assembly language program to add two binary numbers 1010b and 1100b.
6 Marks
b) Write a simple assembly language program to multiply two real numbers 3.72 and 1.78 and
display the answer in four decimal places.
8 Marks
c) Briefly describe the following arithmetic instructions:
i. SUBB
ii. IDV
iii. IMUL
6 Marks
QUESTION FOUR [20 MARKS]
a) Write an assembly language program to add FFFFh and 0001h and store the sum
in an accumulator.
8 Marks
b) Describe any three types of jumps in assembly programming.
3 Marks
c) Write code snippets in assembly language for each of the following cases.
i. Compare unsigned EAX to EBX, and copy the larger of the two into a variable named
Large
ii. Jump to label L1 if the memory word pointed to by ESI equals Zero
iii. Jump to label L2 if the double word in memory pointed to by EDI is even
9 Marks
QUESTION FIVE [20 MARKS]
a) State and explain the bitwise operator suitable for turning off a particular bit in a number.
2 Marks
b) Write an assembly language program to find the smallest number in an array.
6 Marks
c) Write a procedure named multiply that computes the product of two signed 32-bit operands.
The operands will be passed in registers ESI and EDI. The procedure should return the result
on EAX.
6 Marks
d) Write Assembly Language code to evaluate expression: ((a+b)-(c+d))-e. Assume a,b,c,d and
e are integer variables. Hint: Use procedure.
6 Marks

(Visited 166 times, 1 visits today)
Share this:

Written by