Professional Documents
Culture Documents
BSD 1308 - Assembly Language Programming
BSD 1308 - Assembly Language Programming
BSD 1308 - Assembly Language Programming
QUESTION ONE
a) Briefly explain the general format of an assembly program. 4 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) Write an assembly program to read length and width of a rectangle then calculate and display
the area. 8 Marks
QUESTION ONE
A painter wishes to buy some paint to paint a circular surface. There are two types of paints that
must be mixed in equal proportions to painter the surface. Painter A costs Ksh 1500 per liter while
paint B costs Ksh 3000 a liter. The paint consumption is 2 liters per every square meter of the
surface. Write an assembly program that uses procedures to calculate the cost of painting a circular
surface. One of the procedure should be able to read the radius of the circular surface then calculate
the area in square meters. Another procedure should calculate the total cost of painting once it
receives the area of the surface. 20 Marks